Permalink
Browse files

The Bourne Dependency

  • Loading branch information...
1 parent 594ece7 commit 760b7da792e16dbfcbfa201af8f876ecf611b7ec @readeharris readeharris committed with drapergeek Oct 15, 2012
Showing with 4 additions and 11 deletions.
  1. +3 −10 lib/shoulda/matchers/independent/delegate_matcher.rb
  2. +1 −1 shoulda-matchers.gemspec
@@ -1,13 +1,11 @@
+require 'bourne'
+
module Shoulda # :nodoc:
module Matchers
module Independent # :nodoc:
# Ensure that a given method is delegated properly.
#
- # Dependencies:
- # This matcher requires the `bourne` gem be added to your Gemfile. You will receive
- # a warning if this is not the case.
- #
# Basic Syntax:
# it { should delegate_method(:deliver_mail).to(:mailman) }
#
@@ -20,12 +18,7 @@ module Independent # :nodoc:
# it { should delegate_method(:deliver_mail).to(:mailman).with_arguments('221B Baker St.', :hastily => true)
#
def delegate_method(delegating_method)
- begin
- require 'bourne'
- DelegateMatcher.new(delegating_method)
- rescue LoadError
- raise "To use Shoulda's #delegate_method matcher, please add `bourne` to your Gemfile."
- end
+ DelegateMatcher.new(delegating_method)
end
class DelegateMatcher
@@ -18,10 +18,10 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.add_dependency('activesupport', '>= 3.0.0')
+ s.add_dependency('bourne', '~> 1.1.2')
s.add_development_dependency('appraisal', '~> 0.4.0')
s.add_development_dependency('aruba')
- s.add_development_dependency('bourne', '~> 1.1.2')
s.add_development_dependency('bundler', '~> 1.1')
s.add_development_dependency('cucumber', '~> 1.1.9')
s.add_development_dependency('rails', '~> 3.0')

4 comments on commit 760b7da

@tristandunn
Contributor

Any chance of reverting this? Annoying if you don't use the delegate_method matcher, but do use bourne. I can't upgrade due to the semi-strict version requirement.

@gabebw
Member
gabebw commented on 760b7da Dec 6, 2012

Is there a version requirement that would be better for you? Maybe ~> 1.0?

@tristandunn
Contributor

Yes, that would be better, if reverting this isn't an option.

@gabebw
Member
gabebw commented on 760b7da Dec 6, 2012

Let's move this discussion to an issue: #202

Please sign in to comment.