Created
April 9, 2012 12:21
-
-
Save daveworth/2343114 to your computer and use it in GitHub Desktop.
Querying our object's state using RSpec2 instead of a debugger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe RailsyObject do | |
| describe "predicates" do | |
| before do | |
| @railsy_obj = FactoryGirl.create(:railsy_object) | |
| end | |
| describe "#compound?" do | |
| it "should pass for the default object from FactoryGirl" do | |
| @railsy_obj.should be_simple | |
| @railsy_obj.should be_clean | |
| @railsy_obj.should be_complicated | |
| @railsy_obj.should be_compound | |
| end | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle exec rspec spec | |
| F | |
| Failures: | |
| 1) RailsyObject predicates#compound? should pass for the default object from FactoryGirl | |
| Failure/Error: @railsy_obj.should be_simple | |
| expected simple? to return true, got false | |
| # ./spec/models/railsy_object_spec.rb:12:in `block (4 levels) in <top (required)>' | |
| Finished in 0.01648 seconds | |
| 1 example, 1 failure | |
| Failed examples: | |
| rspec ./spec/models/railsy_object_spec.rb:11 # RailsyObject predicates#compound? should pass for the default object from FactoryGirl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment