1 require File.dirname(__FILE__) + '/../../../spec_helper.rb'
3 describe Kernel, "when extended by rspec" do
4 it "should respond to :describe" do
5 Object.new.should respond_to(:describe)
6 Object.new.should respond_to(:context)
10 describe Kernel, " when creating behaviours with describe" do
12 it "should fail when no block given" do
13 lambda { describe "foo" }.should raise_error(ArgumentError)
16 it "should fail when no description given" do
17 lambda { describe do; end }.should raise_error(ArgumentError)
21 describe Kernel, "#respond_to" do
23 @kernel_impersonator = Class.new do
28 it "should return a Spec::Matchers::RespondTo" do
29 @kernel_impersonator.respond_to.should be_an_instance_of(Spec::Matchers::RespondTo)
32 it "should pass the submitted names to the RespondTo instance" do
33 Spec::Matchers::RespondTo.should_receive(:new).with(:a,'b','c?')
34 @kernel_impersonator.respond_to(:a,'b','c?')