diff options
author | André Luis Leal Cardoso Junior <andrehjr@gmail.com> | 2022-04-09 17:27:24 -0300 |
---|---|---|
committer | André Luis Leal Cardoso Junior <andrehjr@gmail.com> | 2022-04-09 17:27:49 -0300 |
commit | 4daa24ded5a74e590ac14a9ff6fc5e3335a4476b (patch) | |
tree | 6fb05cddcc2721d1dce7e19f551a27f2273d5fd8 | |
parent | 4e3fddc490b6579d189916dd92ac065948703c8e (diff) | |
download | pry-4daa24ded5a74e590ac14a9ff6fc5e3335a4476b.tar.gz |
Fix rubocop warnings
-rw-r--r-- | spec/fixtures/test_task.rb | 2 | ||||
-rw-r--r-- | spec/method_spec.rb | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/spec/fixtures/test_task.rb b/spec/fixtures/test_task.rb index dfa86941..714128f1 100644 --- a/spec/fixtures/test_task.rb +++ b/spec/fixtures/test_task.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + task :test_task do binding end diff --git a/spec/method_spec.rb b/spec/method_spec.rb index 8f06c484..d2bf877e 100644 --- a/spec/method_spec.rb +++ b/spec/method_spec.rb @@ -216,7 +216,7 @@ describe Pry::Method do base.send :alias_method, "respond_to?", "respond_to_with_variables?" end - def respond_to_with_variables?(sym, include_priv=false) + def respond_to_with_variables?(sym, include_priv = false) respond_to_without_variables?(sym, include_priv) end end @@ -229,13 +229,13 @@ describe Pry::Method do @tasks[name] = block end - def load - path = File.expand_path("../fixtures/test_task.rb", __FILE__) + def load_task + path = File.expand_path("fixtures/test_task.rb", __dir__) instance_eval File.read(path), path end end - o.load + o.load_task o2 = Object.new o2.singleton_class.send(:include, included_module) @@ -244,7 +244,7 @@ describe Pry::Method do expect(o2.method(:respond_to_without_variables?).source_location).to be_nil b = o2.instance_eval(&o.tasks[:test_task]) - expect(Pry::Method.from_binding(b).name).to eq "load" + expect(Pry::Method.from_binding(b).name).to eq "load_task" end end |