thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer (Jira)" <j...@apache.org>
Subject [jira] [Assigned] (THRIFT-4971) Fix lib/rb/spec/union_spec.rb so that CI succeeds
Date Sun, 06 Oct 2019 10:26:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-4971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jens Geyer reassigned THRIFT-4971:
----------------------------------

    Assignee: Kengo Seki

> Fix lib/rb/spec/union_spec.rb so that CI succeeds
> -------------------------------------------------
>
>                 Key: THRIFT-4971
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4971
>             Project: Thrift
>          Issue Type: Bug
>          Components: Ruby - Library
>            Reporter: Kengo Seki
>            Assignee: Kengo Seki
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I found that recent CI jobs failed with the following error:
> {code}
> 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)>'
> {code}
> 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,
> {code}
>      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
> {code}
> just as the previous test case does as follows:
> {code}
>     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
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message