Skip to content
Browse files

words in features

  • Loading branch information...
1 parent b8d9800 commit 66737e58a54925d52869b4bd2d68e40638fedba7 @dchelimsky dchelimsky committed Apr 17, 2011
Showing with 8 additions and 8 deletions.
  1. +8 −8 features/method_stubs/as_null_object.feature
View
16 features/method_stubs/as_null_object.feature
@@ -3,26 +3,26 @@ Feature: as_null_object method stub
Use the `as_null_object` method to ignore any messages that
aren't explicitly set as stubs or message expectations.
- Scenario: as_null_object implementation
+ Scenario: double acting as_null_object
Given a file named "as_null_object_spec.rb" with:
"""
describe "a double with as_null_object called" do
- subject { double('null object').as_null_object }
+ let(:null_object) { double('null object').as_null_object }
it "responds to any method that is not defined" do
- subject.should respond_to(:an_undefined_method)
+ null_object.should respond_to(:an_undefined_method)
end
it "allows explicit stubs" do
- subject.stub(:foo) { "bar" }
- subject.foo.should eq("bar")
+ null_object.stub(:foo) { "bar" }
+ null_object.foo.should eq("bar")
end
it "allows explicit expectations" do
- subject.should_receive(:something)
- subject.something
+ null_object.should_receive(:something)
+ null_object.something
end
end
"""
When I run `rspec as_null_object_spec.rb`
- Then the examples should all pass
+ Then the examples should all pass

0 comments on commit 66737e5

Please sign in to comment.
Something went wrong with that request. Please try again.