Fix a test that failed when rspec 2 was used #118

Merged
merged 1 commit into from Oct 5, 2012

Conversation

Projects
None yet
4 participants
Contributor

indrekj commented Oct 1, 2012

RSpec1: spec spec => Everything OK
RSpec2: rspec spec =>

  1) Virtus::InstanceMethods#initialize with an argument that responds to #to_hash sets attributes
     Failure/Error: subject.name.should be(name)

       expected #<RSpec::Mocks::Mock:18872480> => #<RSpec::Mocks::Mock:0x11ff8a0 @name="name">
            got #<String:18867120> => "#[RSpec::Mocks::Mock:0x11ff8a0 @name=\"name\"]"

       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       'actual.should eq(expected)' if you don't care about
       object identity in this example.


       Diff:
       @@ -1,2 +1,2 @@
       -#<RSpec::Mocks::Mock:0x11ff8a0 @name="name">
       +"#[RSpec::Mocks::Mock:0x11ff8a0 @name=\"name\"]"

I wasn't 100% sure what was exactly tested here. I tried to change it to as close to the test name as possible. Now it passes with both rspec versions.

Contributor

greyblake commented Oct 2, 2012

Looks similar: #110
Guys do not use Rspec2 since they rely on mutant.

Owner

solnic commented Oct 2, 2012

Small correction - we rely on heckle which requires rspec1 :) Mutant will work with rspec2 so when it's ready we'll upgrade to rspec2.

Contributor

greyblake commented Oct 2, 2012

I think this pull request has a sense since it doesn't break anything (unlike my one) and make spec easier to understand.

Collaborator

mbj commented Oct 2, 2012

@solnic Mutant will work with any test framework as long as a framework specific killer can be written. See the current rspec2 killer.

@solnic solnic added a commit that referenced this pull request Oct 5, 2012

@solnic solnic Merge pull request #118 from indrekj/fix-spec
Fix a test that failed when rspec 2 was used
0bd923a

@solnic solnic merged commit 0bd923a into solnic:master Oct 5, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment