Reputation: 10882
I am converting a Ruby program to Crystal as I learn it.
Here is an error message I am getting:
# Error
Failures:
1) Test Rule class can return the name property
Failure/Error: rule.name.should be "RpsIphone"
Expected: "RpsIphone" (object_id: 4504126256)
got: "RpsIphone" (object_id: 4524981536)
# spec/rule_spec.cr:11
And here is the code that is causing it
# from spec
rule.name.should be "RpsIphone"
I also checked that the two strings when compared with .same? also say they are not the same. I've looked at those 9 characters over and over. What am I missing?
Upvotes: 1
Views: 60
Reputation: 10882
.should be
tests for the objects being the same,
identical, same object_id.should eq
tests for the values being the sameUpvotes: 5