Skip to content

Commit

Permalink
Rubocop autocorrected: Style/BracesAroundHashParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jun 5, 2015
1 parent 9277132 commit 4400712
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .rubocop.yml
Expand Up @@ -91,12 +91,6 @@ Metrics/PerceivedComplexity:
Style/AccessorMethodName:
Enabled: false

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/BracesAroundHashParameters:
Enabled: false

# Offense count: 8
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren:
Expand Down
8 changes: 4 additions & 4 deletions tests/ruby/builtins_spec.rb
Expand Up @@ -330,7 +330,7 @@

h = { :a => 1, :b => 2 }
res = Yast::Builtins.change(h, :c, 3)
expect(res).to eq({:a => 1, :b => 2, :c => 3})
expect(res).to eq(:a => 1, :b => 2, :c => 3)
expect(h).to eq(({:a => 1, :b => 2}))
end

Expand All @@ -340,7 +340,7 @@
expect(Yast::Builtins.isempty({})).to eq(true)
expect(Yast::Builtins.isempty("")).to eq(true)
expect(Yast::Builtins.isempty([1])).to eq(false)
expect(Yast::Builtins.isempty({"a" => "b"})).to eq(false)
expect(Yast::Builtins.isempty("a" => "b")).to eq(false)
expect(Yast::Builtins.isempty("foo")).to eq(false)
end

Expand Down Expand Up @@ -727,9 +727,9 @@

expect(Yast::Builtins.mapmap(nil) {|k,v| {v => k}}).to eq(nil)

expect(Yast::Builtins.mapmap({2=>1,4=>3}) {|k,v| next {v => k}}).to eq(Hash[1=>2,3=>4])
expect(Yast::Builtins.mapmap(2=>1,4=>3) {|k,v| next {v => k}}).to eq(Hash[1=>2,3=>4])

res = Yast::Builtins.mapmap({2=>1,4=>3}) do |k,v|
res = Yast::Builtins.mapmap(2=>1,4=>3) do |k,v|
raise Yast::Break if k == 4
next {v => k}
end
Expand Down
4 changes: 2 additions & 2 deletions tests/ruby/ops_spec.rb
Expand Up @@ -114,15 +114,15 @@
expect(Yast::Ops.less_than("s",Yast::Term.new(:a,1,3))).to eq(true)
expect(Yast::Ops.less_than(:a,Yast::Term.new(:b,1,1))).to eq(true)
expect(Yast::Ops.less_than({ :a => "b"},Yast::Term.new(:b))).to eq(false)
expect(Yast::Ops.less_than({"a" => 1, 1 => 2},{"a" => 1, "b" => 2})).to eq(true)
expect(Yast::Ops.less_than({"a" => 1, 1 => 2},"a" => 1, "b" => 2)).to eq(true)
end

describe "Ops.get" do
context "when the container is a map" do
let(:map) { { "a" => { "b" => "c" }} }

it "returns value if key exists" do
expect(Yast::Ops.get(map,"a","n")).to eq({ "b" => "c"})
expect(Yast::Ops.get(map,"a","n")).to eq("b" => "c")
end

it "supports nested access with list of keys" do
Expand Down

0 comments on commit 4400712

Please sign in to comment.