Skip to content

assign_to matcher in 1.9.2 #155

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

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
thoughtbot, inc. member
jferris commented Feb 2, 2011

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

@kollektiv

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

@jferris
thoughtbot, inc. 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

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
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: james2m/shoulda-context@ad00e58 and james2m/shoulda-matchers@a28a184

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
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
thoughtbot, inc. member
jferris commented Mar 17, 2011

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

@pjg
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
Something went wrong with that request. Please try again.