Skip to content

Extract Rails extension to have matcher #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 25, 2014
Merged

Conversation

soulcutter
Copy link
Member

I'm not sure this is the best way to conditionally load the matcher extension, but I figured it's at least a workable first pass.

This is half of rspec/rspec-rails#808

@soulcutter
Copy link
Member Author

Looks like this is failing on Travis - it was passing for me locally so I'm not immediately certain what is amiss. HMM.

@@ -0,0 +1,8 @@
module RSpec
module CollectionMatchers
module Rails
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to define an empty module?

@hugobarauna
Copy link
Member

@soulcutter Maybe it's failing because the Rails constant is not defined. If that's the problem, we could fix that by just stubing that constant using RSpec itself.

@soulcutter
Copy link
Member Author

It shouldn't have to do with the Rails constant - the spec explicitly requires the have extensions without checking the constant at all. I'm more thinking it may have to do with me testing against the master branches of everything vs travis building with the 2-99-maintenance branch.

@JonRowe
Copy link
Member

JonRowe commented Aug 20, 2013

@soulcutter Although you've now linked this to master, it needs to work with 2-99-maintenance too, as otherwise there isn't a smooth upgrade path

@@ -7,12 +7,15 @@ gemspec
if File.exist?(library_path)
gem lib, :path => library_path
else
gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => "2-99-maintenance"
gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => "master"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to ensure this works against 2-99-maintenance and master

@myronmarston
Copy link
Member

Bump..this needs to still be worked out.

@myronmarston myronmarston mentioned this pull request Feb 19, 2014
@hugobarauna
Copy link
Member

@soulcutter are you going to continue working on this? I can work on that if you're not going to.

@soulcutter
Copy link
Member Author

I think I solved the 2.99 compatibility issue, let's see what Travis says…

EDIT: Nope… looks like something is different in 1.8.x rubies.

instance_methods returns an array of symbols in Ruby 1.9+
but before that it was an array of strings.
@soulcutter
Copy link
Member Author

Looks like the build works now. Any other feedback?

end
end
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excess white space

@soulcutter
Copy link
Member Author

@hugobarauna I'm all done with this one - care to comment / merge?

@@ -0,0 +1,58 @@
require 'rspec/collection_matchers/have'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we need that require here, since we're already loading that file in lib/rspec/collection_matchers/rails

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure rails.rb really deserves to exist, honestly. It's not actually loaded there, though, it's really coming from lib/rspec/collection_matchers.rb

@hugobarauna
Copy link
Member

:shipit:

soulcutter added a commit that referenced this pull request Feb 25, 2014
Extract Rails extension to have matcher
@soulcutter soulcutter merged commit a8024af into master Feb 25, 2014
@soulcutter soulcutter deleted the rails-have-extensions branch February 25, 2014 15:30
alexrothenberg pushed a commit to alexrothenberg/rspec-rails that referenced this pull request Apr 7, 2014
This functionality was extracted into
rspec/rspec-collection_matchers#5

Fixes rspec#808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants