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

Already on GitHub? Sign in to your account

Updates for compatibility with rspec-expectations #482

Merged
merged 1 commit into from Jan 19, 2012

Conversation

Projects
None yet
3 participants
Contributor

wfarr commented Jan 12, 2012

No description provided.

Owner

dchelimsky commented Jan 13, 2012

Thanks for doing this. Unfortunately it exposes the fact that we can't release the BuiltIn module until a 2.9 release, but I guess that's good to know :)

Owner

myronmarston commented Jan 13, 2012

Thanks for doing this. Unfortunately it exposes the fact that we can't release the BuiltIn module until a 2.9 release, but I guess that's good to know :)

I think we can actually use const_missing to provide compatibility, similar to this approach:

http://myronmars.to/n/dev-blog/2011/09/deprecating-constants-and-classes-in-ruby

Owner

dchelimsky commented Jan 13, 2012

@myronmarston assuming you mean doing that in rspec-expectations for the constants that rspec-rails depends on, yes, I think that could work, though I don't think there's any need to visibly deprecate them since rspec-rails is the only consumer. Agree?

Owner

dchelimsky commented Jan 13, 2012

@myronmarston actually we'll have to do it in both libs because people might upgrade to rspec-rails-2.8.2 and not rspec-expecations-2.8.1. All the combinations within 2.8.x need to play nice together.

Owner

myronmarston commented Jan 13, 2012

Hmm...one other potentially simpler idea. In rspec-rails, we could do something like:

module RSpec
  module Matchers
    unless defined?(BuiltIn)
      module BuiltIn
        include ::RSpec::Matchers
      end
    end
  end
end

Essentially, have rspec-rails make a dummy BuiltIn module with all of the constants in RSpec::Matchers for compatibility, if there's not a BuiltIn module already there.

Owner

dchelimsky commented Jan 13, 2012

@myronmarston that's a sane approach for rspec-rails, but we still need to do something in rspec-expectations for those who update rspec-expectations and not rspec-rails.

@dchelimsky dchelimsky added a commit that referenced this pull request Jan 19, 2012

@dchelimsky dchelimsky Merge pull request #482 from wfarr/master
Updates for compatibility with rspec-expectations
caa5830

@dchelimsky dchelimsky merged commit caa5830 into rspec:master Jan 19, 2012

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