assign_to matcher in 1.9.2 #155

Closed
kollektiv opened this Issue Feb 2, 2011 · 8 comments

Comments

Projects
None yet
5 participants
@kollektiv

instance_variables() in 1.9.2 returns symbols instead of strings, which breaks the assign_to matcher when using 1.9.2.

Fixes here: kollektiv/shoulda-matchers@713abb1

Tested with 1.8.7 and 1.9.2.

Edit: Updated commit link

@jferris

This comment has been minimized.

Show comment
Hide comment
@jferris

jferris Feb 2, 2011

Member

Thanks for the patch. I had a couple comments on your commit - can you take a look?

Member

jferris commented Feb 2, 2011

Thanks for the patch. I had a couple comments on your commit - can you take a look?

@kollektiv

This comment has been minimized.

Show comment
Hide comment
@kollektiv

kollektiv Feb 2, 2011

I updated the commit link in this issue and added some comments. kollektiv/shoulda-matchers@713abb1

I updated the commit link in this issue and added some comments. kollektiv/shoulda-matchers@713abb1

@jferris

This comment has been minimized.

Show comment
Hide comment
@jferris

jferris Feb 3, 2011

Member

With regards to Minitest, I was wondering what would happen in an actual 1.8.7 application using Test::Unit or RSpec if MiniTest::Assertion isn't defined. The tests pass because it's defined in spec_helper, but will applications using shoulda need to define it as well?

Member

jferris commented Feb 3, 2011

With regards to Minitest, I was wondering what would happen in an actual 1.8.7 application using Test::Unit or RSpec if MiniTest::Assertion isn't defined. The tests pass because it's defined in spec_helper, but will applications using shoulda need to define it as well?

@kollektiv

This comment has been minimized.

Show comment
Hide comment
@kollektiv

kollektiv Feb 3, 2011

Ah you're right, it wouldn't have worked in 1.8.7. I pushed some fixes here. Additionally, I made a small change to shoulda-context to get cucumber tests to pass in 1.9.2.

Ah you're right, it wouldn't have worked in 1.8.7. I pushed some fixes here. Additionally, I made a small change to shoulda-context to get cucumber tests to pass in 1.9.2.

@james2m

This comment has been minimized.

Show comment
Hide comment
@james2m

james2m Feb 15, 2011

Should split out the fix for the assign_to matcher from the MiniTest break from using Test::Unit::AssertionFailedError?

I put some fixes in for the minitest: https://github.com/james2m/shoulda-context/commit/ad00e589809e6bdbfed9e68a18512e3d1907a0a5 and https://github.com/james2m/shoulda-matchers/commit/a28a184cbb3f95498143f59c8aa38e40fafe917c

Rather than re-factoring use of Test::Unit::AssertionFailedError out of shoulda I just added this to test_unit integration;

module Test
  module Unit
    AssertionFailedError = MiniTest::Assertion if defined?(MiniTest) && !defined?(AssertionFailedError)
  end
end

james2m commented Feb 15, 2011

Should split out the fix for the assign_to matcher from the MiniTest break from using Test::Unit::AssertionFailedError?

I put some fixes in for the minitest: https://github.com/james2m/shoulda-context/commit/ad00e589809e6bdbfed9e68a18512e3d1907a0a5 and https://github.com/james2m/shoulda-matchers/commit/a28a184cbb3f95498143f59c8aa38e40fafe917c

Rather than re-factoring use of Test::Unit::AssertionFailedError out of shoulda I just added this to test_unit integration;

module Test
  module Unit
    AssertionFailedError = MiniTest::Assertion if defined?(MiniTest) && !defined?(AssertionFailedError)
  end
end
@pjg

This comment has been minimized.

Show comment
Hide comment
@pjg

pjg Mar 17, 2011

Could you please release a new version, which includes this fix? You cannot really use the assign_to matcher in Ruby 1.9.2.

And it's kind of cumbersome to bundle the shoulda-matchers gem from the git repository instead of rubygems.

pjg commented Mar 17, 2011

Could you please release a new version, which includes this fix? You cannot really use the assign_to matcher in Ruby 1.9.2.

And it's kind of cumbersome to bundle the shoulda-matchers gem from the git repository instead of rubygems.

@jferris

This comment has been minimized.

Show comment
Hide comment
@jferris

jferris Mar 17, 2011

Member

I just pushed beta2, which contains this fix. Thanks for your patience.

Member

jferris commented Mar 17, 2011

I just pushed beta2, which contains this fix. Thanks for your patience.

@pjg

This comment has been minimized.

Show comment
Hide comment
@pjg

pjg Mar 17, 2011

Thank you!

pjg commented Mar 17, 2011

Thank you!

@jasonm jasonm closed this Nov 2, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment