Created
September 6, 2012 00:36
-
-
Save steveklabnik/3648829 to your computer and use it in GitHub Desktop.
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
| $ rspec | |
| F | |
| Failures: | |
| 1) Person compares birthdays | |
| Failure/Error: joe.birthday.should == jon.birthday | |
| expected: "7/6/1986" | |
| got: "5/6/1986" (using ==) | |
| # ./spec/person_spec.rb:9:in `block (2 levels) in' | |
| Finished in 0.00053 seconds | |
| 1 example, 1 failure | |
| Failed examples: | |
| rspec ./spec/person_spec.rb:5 # Person compares birthdays |
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
| class Person | |
| attr_accessor :name, :birthday | |
| Birthday = Struct.new(:day, :month, :year) | |
| def initialize(opts = {}) | |
| @name = opts[:name] | |
| @birthday = Birthday.new(opts[:day], opts[:month], opts[:year]) | |
| 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
| $ rspec | |
| F | |
| Failures: | |
| 1) Person compares birthdays | |
| Failure/Error: joe.birthday.should == jon.birthday | |
| expected: # | |
| got: # (using ==) | |
| Diff: | |
| @@ -1,2 +1,2 @@ | |
| -# | |
| +# | |
| # ./spec/person_spec.rb:9:in `block (2 levels) in' | |
| Finished in 0.00092 seconds | |
| 1 example, 1 failure | |
| Failed examples: | |
| rspec ./spec/person_spec.rb:5 # Person compares birthdays |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment