Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Extract method #implemented_methods

  • Loading branch information...
commit 2b057f39f90e98c4402b1e7525b55695a7297b2b 1 parent e14f263
@xaviershay authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/rspec/fire.rb
View
12 lib/rspec/fire.rb
@@ -147,11 +147,14 @@ def with_doubled_class
protected
- def unimplemented_methods(doubled_class, expected_methods, checked_methods)
- implemented_methods = doubled_class.send(checked_methods)
+ def implemented_methods(doubled_class, checked_methods)
+ doubled_class.send(checked_methods)
+ end
+ def unimplemented_methods(doubled_class, expected_methods, checked_methods)
# to_sym for non-1.9 compat
- expected_methods - implemented_methods.map(&:to_sym)
+ expected_methods -
+ implemented_methods(doubled_class, checked_methods).map(&:to_sym)
end
def ensure_implemented(*method_names)
@@ -164,7 +167,8 @@ def ensure_implemented(*method_names)
if methods.any?
implemented_methods =
- Object.public_methods - doubled_class.send(@__checked_methods)
+ Object.public_methods -
+ implemented_methods(doubled_class, @__checked_methods)
msg = "%s does not implement:\n%s" % [
doubled_class,
Please sign in to comment.
Something went wrong with that request. Please try again.