summaryrefslogtreecommitdiff
path: root/spec/commands/find_method_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/commands/find_method_spec.rb')
-rw-r--r--spec/commands/find_method_spec.rb34
1 files changed, 19 insertions, 15 deletions
diff --git a/spec/commands/find_method_spec.rb b/spec/commands/find_method_spec.rb
index a00e8b90..a579cc71 100644
--- a/spec/commands/find_method_spec.rb
+++ b/spec/commands/find_method_spec.rb
@@ -1,21 +1,27 @@
require_relative '../helper'
-MyKlass = Class.new do
- def hello
- "timothy"
- end
- def goodbye
- "jenny"
- end
- def tea_tim?
- "timothy"
+describe "find-method" do
+ before do
+ class MyKlass
+ def hello
+ "timothy"
+ end
+ def goodbye
+ "jenny"
+ end
+ def tea_tim?
+ "timothy"
+ end
+ def tea_time?
+ "polly"
+ end
+ end
end
- def tea_time?
- "polly"
+
+ after do
+ Object.remove_const :MyKlass
end
-end
-describe "find-method" do
describe "find matching methods by name regex (-n option)" do
it "should find a method by regex" do
pry_eval("find-method hell MyKlass").should =~
@@ -59,5 +65,3 @@ describe "find-method" do
pry_eval('find-method tea_time\? MyKlass').should =~ good
end
end
-
-Object.remove_const(:MyKlass)