You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it'can handle unary plus in an argument list'dosource=['assert_difference MyModel.count, +2 do',' puts "a thing"','end']inspect_source(cop,source)expect(cop.offenses.size).toeq(0)end
Result:
rspec spec/rubocop/cop/style/extra_spacing_spec.rb
Run options:
include {:focus=>true}
exclude {:broken=>#<Proc:./spec/spec_helper.rb:32>, :ruby_greater_than_or_equal=>#<Proc:./spec/spec_helper.rb:28>, :ruby_less_than=>#<Proc:./spec/spec_helper.rb:25>, :ruby=>#<Proc:./spec/spec_helper.rb:22>}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 30038
..F.................F...................
Failures:
1) RuboCop::Cop::Style::ExtraSpacing when AllowForAlignment is false can handle unary plus in an argument list
Failure/Error: expect(cop.offenses.size).to eq(0)
expected: 0
got: 1
(compared using ==)
Shared Example Group: "common behavior" called from ./spec/rubocop/cop/style/extra_spacing_spec.rb:181
# ./spec/rubocop/cop/style/extra_spacing_spec.rb:39:in `block (3 levels) in <top (required)>'
2) RuboCop::Cop::Style::ExtraSpacing when AllowForAlignment is true can handle unary plus in an argument list
Failure/Error: expect(cop.offenses.size).to eq(0)
expected: 0
got: 1
(compared using ==)
Shared Example Group: "common behavior" called from ./spec/rubocop/cop/style/extra_spacing_spec.rb:164
# ./spec/rubocop/cop/style/extra_spacing_spec.rb:39:in `block (3 levels) in <top (required)>'
Finished in 0.06017 seconds (files took 0.34958 seconds to load)
40 examples, 2 failures
Failed examples:
rspec './spec/rubocop/cop/style/extra_spacing_spec.rb[1:2:4]' # RuboCop::Cop::Style::ExtraSpacing when AllowForAlignment is false can handle unary plus in an argument list
rspec './spec/rubocop/cop/style/extra_spacing_spec.rb[1:1:4]' # RuboCop::Cop::Style::ExtraSpacing when AllowForAlignment is true can handle unary plus in an argument list
Randomized with seed 30038
Note: Normally I'd say that the unary plus here is redundant, but in this case we like it for clarity (with assert_difference in this case). In any case, it does not have extra spaces.
The text was updated successfully, but these errors were encountered:
Test:
Result:
Note: Normally I'd say that the unary plus here is redundant, but in this case we like it for clarity (with
assert_difference
in this case). In any case, it does not have extra spaces.The text was updated successfully, but these errors were encountered: