Skip to content

Commit

Permalink
Merge pull request ManageIQ#14156 from lpichler/fix_format_of_field_i…
Browse files Browse the repository at this point in the history
…n_specs

Fix format of fields in specs
  • Loading branch information
martinpovolny authored Mar 6, 2017
2 parents b29ce5e + de9a471 commit c05dd92
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec/lib/miq_expression_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1445,25 +1445,25 @@
it "generates the ruby for a FIND expression with checkall" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkall" => {">" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkall" => {">" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=all><value ref=vm, type=string>/virtual/hardware/cpu_sockets</value> > \"2\"</check></find>"
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=all><value ref=vm, type=integer>/virtual/hardware/cpu_sockets</value> > 2</check></find>"
expect(actual).to eq(expected)
end

it "generates the ruby for a FIND expression with checkany" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkany" => {">" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkany" => {">" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=any><value ref=vm, type=string>/virtual/hardware/cpu_sockets</value> > \"2\"</check></find>"
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=any><value ref=vm, type=integer>/virtual/hardware/cpu_sockets</value> > 2</check></find>"
expect(actual).to eq(expected)
end

it "generates the ruby for a FIND expression with checkcount and =" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkcount" => {"=" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkcount" => {"=" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=count><count> == 2</check></find>"
expect(actual).to eq(expected)
Expand All @@ -1472,7 +1472,7 @@
it "generates the ruby for a FIND expression with checkcount and !=" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkcount" => {"!=" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkcount" => {"!=" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=count><count> != 2</check></find>"
expect(actual).to eq(expected)
Expand All @@ -1481,7 +1481,7 @@
it "generates the ruby for a FIND expression with checkcount and <" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkcount" => {"<" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkcount" => {"<" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=count><count> < 2</check></find>"
expect(actual).to eq(expected)
Expand All @@ -1490,7 +1490,7 @@
it "generates the ruby for a FIND expression with checkcount and >" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkcount" => {">" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkcount" => {">" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=count><count> > 2</check></find>"
expect(actual).to eq(expected)
Expand All @@ -1499,7 +1499,7 @@
it "generates the ruby for a FIND expression with checkcount and <=" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkcount" => {"<=" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkcount" => {"<=" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=count><count> <= 2</check></find>"
expect(actual).to eq(expected)
Expand All @@ -1508,7 +1508,7 @@
it "generates the ruby for a FIND expression with checkcount and >=" do
actual = described_class.new(
"FIND" => {"search" => {"=" => {"field" => "Vm-name", "value" => "foo"}},
"checkcount" => {">=" => {"field" => "Vm.hardware.cpu_sockets", "value" => "2"}}}
"checkcount" => {">=" => {"field" => "Vm.hardware-cpu_sockets", "value" => "2"}}}
).to_ruby
expected = "<find><search><value ref=vm, type=string>/virtual/name</value> == \"foo\"</search><check mode=count><count> >= 2</check></find>"
expect(actual).to eq(expected)
Expand Down

0 comments on commit c05dd92

Please sign in to comment.