Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / spec / spec / runner / extensions / kernel_spec.rb
blob6b253a06a5d695205ade453edc5793b633f22aed
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)
7   end
8 end
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)
14   end
16   it "should fail when no description given" do
17     lambda { describe do; end }.should raise_error(ArgumentError)
18   end
19 end
21 describe Kernel, "#respond_to" do
22   before(:each) do
23     @kernel_impersonator = Class.new do
24       include Kernel
25     end.new
26   end
27   
28   it "should return a Spec::Matchers::RespondTo" do
29     @kernel_impersonator.respond_to.should be_an_instance_of(Spec::Matchers::RespondTo)
30   end
31   
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?')
35   end
36 end