Browse files

Extract method #implemented_methods

  • Loading branch information...
1 parent e14f263 commit 2b057f39f90e98c4402b1e7525b55695a7297b2b @xaviershay committed Jul 4, 2012
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,

0 comments on commit 2b057f3

Please sign in to comment.