1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

rubocop: fix offences of the Layout/EmptyLinesAroundArguments cop

This commit is contained in:
Kyrylo Silin 2018-11-04 16:42:25 +08:00
parent 372cbbdb15
commit d069ca381b
23 changed files with 0 additions and 57 deletions

View file

@ -198,13 +198,6 @@ Layout/EmptyLinesAroundArguments:
Exclude:
- 'spec/command_spec.rb'
# Offense count: 53
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Enabled: false
# Offense count: 47
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.

View file

@ -143,7 +143,6 @@ class Pry
prefix = indent_level
input.lines.each do |line|
if in_string?
tokens = tokenize("#{open_delimiters_line}\n#{line}")
tokens = tokens.drop_while{ |token, type| !(String === token && token.include?("\n")) }

View file

@ -51,7 +51,6 @@ describe Pry::Hooks do
expect(run).to equal true
expect(run2).to equal true
end
end
describe "processing options" do
@ -83,6 +82,5 @@ describe Pry::Hooks do
expect(run).to eq true
expect(run2).to eq true
end
end
end

View file

@ -102,7 +102,6 @@ describe Pry::CodeObject do
it 'finds nothing when passing nil as the first argument' do
expect(Pry::CodeObject.lookup(nil, @p)).to eq nil
end
end
it 'should lookup instance methods defined on classes accessed via local variable' do

View file

@ -579,7 +579,6 @@ describe Pry::CommandSet do
end
describe '.process_line' do
it 'should return Result.new(false) if there is no matching command' do
result = @set.process_line('1 + 42')
expect(result.command?).to eq false

View file

@ -1,14 +1,12 @@
require_relative 'helper'
describe "Pry::Command" do
before do
@set = Pry::CommandSet.new
@set.import Pry::Commands
end
describe 'call_safely' do
it 'should display a message if gems are missing' do
cmd = @set.create_command "ford-prefect", "From a planet near Beetlegeuse", requires_gem: %w(ghijkl) do
#
@ -176,7 +174,6 @@ describe "Pry::Command" do
end
describe 'classy api' do
it 'should call setup, then subcommands, then options, then process' do
cmd = @set.create_command 'rooster', "Has a tasty towel" do
def setup
@ -237,7 +234,6 @@ describe "Pry::Command" do
it 'should allow overriding options after definition' do
cmd = @set.create_command(/number-(one|two)/, "Lieutenants of the Golgafrinchan Captain", shellwords: false) do
command_options listing: 'number-one'
end
@ -369,7 +365,6 @@ describe "Pry::Command" do
Pry.config.collision_warning = true
cmd = @set.command '_frankie' do
end
_frankie = 'boyle'
@ -386,7 +381,6 @@ describe "Pry::Command" do
Pry.config.collision_warning = true
cmd = @set.command 'frankie' do
end
output = StringIO.new
@ -469,7 +463,6 @@ describe "Pry::Command" do
end
describe "block-related content removed from arguments" do
describe "arg_string" do
it 'should remove block-related content from arg_string (with one normal arg)' do
@set.block_command "walking-spanish", "down the hall", takes_block: true do |x, y|
@ -643,7 +636,6 @@ describe "Pry::Command" do
end
describe "a command made with a custom sub-class" do
before do
class MyTestCommand < Pry::ClassCommand
match(/my-*test/)
@ -727,7 +719,6 @@ describe "Pry::Command" do
end
end
end
end
describe "commands can save state" do
@ -752,7 +743,6 @@ describe "Pry::Command" do
state.my_state += 2
end
end
end.import Pry::Commands
@t = pry_tester(commands: @set)

View file

@ -526,7 +526,6 @@ describe "edit" do
expect(@file).to eq @tempfile_path
expect(@line).to eq 14
end
it "should correctly find an instance method" do
@ -718,7 +717,6 @@ describe "edit" do
end
it "should change the alias, but not the original, without breaking super" do
$x = :bebe
pry_eval 'edit -p X#c'

View file

@ -11,7 +11,6 @@ describe "play" do
end
describe "with an argument" do
# can't think of a f*cking way to test this!!
describe "implied file" do
# it 'should play from the file associated with the current binding' do

View file

@ -11,7 +11,6 @@ describe "show-doc" do
end
def @o.no_docs;end
end
after do

View file

@ -223,7 +223,6 @@ describe "show-source" do
end
it "finds super methods with explicit method argument" do
o = Foo.new
def o.foo(*_bars)
:wibble
@ -455,7 +454,6 @@ describe "show-source" do
end
it 'should lookup module name with respect to current context' do
temporary_constants(:AlphaClass, :BetaClass) do
class BetaClass
def alpha

View file

@ -1,7 +1,6 @@
require_relative '../helper'
describe "watch expression" do
# Custom eval that will:
# 1) Create an instance of pry that can use for multiple calls
# 2) Exercise the after_eval hook

View file

@ -248,5 +248,4 @@ describe "whereami" do
it "should work inside an object" do
expect(pry_eval(Object.new, 'whereami')).to match(/Inside #<Object/)
end
end

View file

@ -58,11 +58,9 @@ describe Pry::InputCompleter do
# Complete class variables.
b = Pry.binding_for(object.class)
completer_test(b).call('@@number', '@@number.class')
end
it 'should complete for stdlib symbols' do
o = Object.new
# Regexp
completer_test(o).call('/foo/.extend')
@ -135,7 +133,6 @@ describe Pry::InputCompleter do
end
it 'should complete for stdlib symbols' do
o = Object.new
# Regexp
completer_test(o).call('/foo/.extend')

View file

@ -1,9 +1,7 @@
require_relative 'helper'
describe Pry::DEFAULT_CONTROL_D_HANDLER do
describe "control-d press" do
before do
# Simulates a ^D press.
@control_d = "Pry::DEFAULT_CONTROL_D_HANDLER.call('', _pry_)"
@ -56,7 +54,5 @@ describe Pry::DEFAULT_CONTROL_D_HANDLER do
end
end
end
end
end

View file

@ -68,5 +68,4 @@ describe Pry::Helpers::DocumentationHelpers do
expect(@helper.process_rdoc("--\n comment in a bubble\n++")).to match(/\+\+/)
end
end
end

View file

@ -89,7 +89,6 @@ asfadsssaaad fasfaafdssd s
it 'should not raise error' do
expect { Pry::Helpers.tablify(@out, @elem_len - 1) }.not_to raise_error
end
it 'should format output as one column' do

View file

@ -138,7 +138,6 @@ describe Pry::Hooks do
expect(h2.get_hook(:test_hook3, :testing)).to eq nil
end
end
end
end
@ -169,7 +168,6 @@ describe Pry::Hooks do
expect(hooks_dup.get_hook(:test_hook, :testing2)).not_to eq @hooks.get_hook(:test_hook, :testing2)
end
end
describe "getting hooks" do
@ -323,7 +321,6 @@ describe Pry::Hooks do
end
describe "target" do
it 'should yield the target, as a binding ' do
b = nil
Pry.config.hooks.add_hook(:when_started, :test_hook) { |target, opt, _| b = target }
@ -362,7 +359,6 @@ describe Pry::Hooks do
expect(o.value).to eq true
Pry.config.hooks.delete_hook(:when_started, :test_hook)
end
end
describe "after_session hook" do
@ -423,7 +419,6 @@ describe Pry::Hooks do
expect(out.string).not_to match(/little_duck/)
end
end
end
describe "exceptions" do
@ -469,5 +464,4 @@ describe Pry::Hooks do
expect(x).to eq 2
end
end
end

View file

@ -1,7 +1,6 @@
require_relative '../helper'
describe Pry::Method::Patcher do
before do
@x = Object.new
def @x.test; :before; end

View file

@ -437,7 +437,6 @@ describe Pry::Method do
def eigen_class(obj); class << obj; self; end; end
it "should look at a class and then its superclass" do
expect(Pry::Method.instance_resolution_order(LS::Next)).to eq [LS::Next] + Pry::Method.instance_resolution_order(LS::Top)
end

View file

@ -66,7 +66,6 @@ describe "test Pry defaults" do
Pry.start(self, input: arity_multi_input, output: StringIO.new)
expect(arity_multi_input.prompt).to eq nil
end
end
it 'should set the output default, and the default should be overridable' do
@ -288,7 +287,6 @@ describe "test Pry defaults" do
end
describe "given a regular object with an #inspect string longer than the maximum specified" do
describe "when the object is a regular one" do
it "returns a string of the #<class name:object idish> format" do
o = Object.new
@ -333,11 +331,8 @@ describe "test Pry defaults" do
expect(Pry.view_clip(m, DEFAULT_OPTIONS)).to eq m.name
end
end
end
end
end
describe 'quiet' do

View file

@ -72,7 +72,6 @@ describe Pry do
end
describe "Pry.binding_for" do
# regression test for burg's bug (see git history)
it "Should not error when object doesn't have a valid == method" do
o = Object.new
@ -379,7 +378,6 @@ describe Pry do
end
describe "Object#pry" do
after do
Pry.reset_defaults
Pry.config.color = false

View file

@ -96,7 +96,6 @@ describe "Sticky locals (_file_ and friends)" do
expect(o.instance_variable_get(:@value)).to eq :john
Pry.config.extra_sticky_locals = {}
end
end
describe "passing in as hash option when creating pry instance" do
@ -171,5 +170,4 @@ describe "Sticky locals (_file_ and friends)" do
expect(value1).not_to eq(value2)
end
end
end

View file

@ -1,7 +1,6 @@
require_relative 'helper'
describe Pry::WrappedModule do
describe "#initialize" do
it "should raise an exception when a non-module is passed" do
expect { Pry::WrappedModule.new(nil) }.to raise_error ArgumentError