lib/rr/extensions/double_methods.rb in rr-0.1.6 vs lib/rr/extensions/double_methods.rb in rr-0.1.7
- old
+ new
@@ -33,45 +33,45 @@
# Sets up an Anything wildcard ArgumentEqualityError
# that succeeds when passed any argument.
# mock(object).method_name(anything) {return_value}
# object.method_name("an arbitrary value") # passes
def anything
- RR::Expectations::WildcardMatchers::Anything.new
+ RR::WildcardMatchers::Anything.new
end
# Sets up an IsA wildcard ArgumentEqualityError
# that succeeds when passed an argument of a certain type.
# mock(object).method_name(is_a(String)) {return_value}
# object.method_name("A String") # passes
def is_a(klass)
- RR::Expectations::WildcardMatchers::IsA.new(klass)
+ RR::WildcardMatchers::IsA.new(klass)
end
# Sets up an Numeric wildcard ArgumentEqualityError
# that succeeds when passed an argument that is ::Numeric.
# mock(object).method_name(numeric) {return_value}
# object.method_name(99) # passes
def numeric
- RR::Expectations::WildcardMatchers::Numeric.new
+ RR::WildcardMatchers::Numeric.new
end
# Sets up an Boolean wildcard ArgumentEqualityError
# that succeeds when passed an argument that is a ::Boolean.
# mock(object).method_name(boolean) {return_value}
# object.method_name(false) # passes
def boolean
- RR::Expectations::WildcardMatchers::Boolean.new
+ RR::WildcardMatchers::Boolean.new
end
# Sets up a DuckType wildcard ArgumentEqualityError
# that succeeds when passed the argument implements the methods.
# arg = Object.new
# def arg.foo; end
# def arg.bar; end
# mock(object).method_name(duck_type(:foo, :bar)) {return_value}
# object.method_name(arg) # passes
def duck_type(*args)
- RR::Expectations::WildcardMatchers::DuckType.new(*args)
+ RR::WildcardMatchers::DuckType.new(*args)
end
instance_methods.each do |name|
alias_method "rr_#{name}", name
end