Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I found that recent CI jobs failed with the following error:
Failures: 1) Union Thrift::Union should raise for wrong set field when hash initialized and type checking is off Failure/Error: expect(example).to raise_error(RuntimeError, "set_field is not valid for this union!") You must pass a block rather than an argument to `expect` to use the provided block expectation matcher (raise RuntimeError with "set_field is not valid for this union!"). # ./spec/union_spec.rb:55:in `block (3 levels) in <top (required)>'
rspec-expectations 3.8.5 was released three or four days ago, and it probably caused this error. In accordance with the message, the test case in question should be fixed as follows,
it "should raise for wrong set field when hash initialized and type checking is off" do Thrift.type_checking = false union = SpecNamespace::My_union.new({incorrect_field: :incorrect}) - example = lambda { Thrift::Serializer.new.serialize(union) } - expect(example).to raise_error(RuntimeError, "set_field is not valid for this union!") + expect { Thrift::Serializer.new.serialize(union) }.to raise_error(RuntimeError, "set_field is not valid for this union!") end
just as the previous test case does as follows:
it "should raise for wrong set field" do union = SpecNamespace::My_union.new union.integer32 = 25 expect { union.some_characters }.to raise_error(RuntimeError, "some_characters is not union's set field.") end
Attachments
Issue Links
- links to