1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

The Bourne Dependency

This commit is contained in:
Reade Harris 2012-10-15 16:24:22 -04:00 committed by Jason Draper
parent 594ece71e4
commit 760b7da792
2 changed files with 4 additions and 11 deletions

View file

@ -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 Shoulda # :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

View file

@ -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')