THRIFT-4971: Fix lib/rb/spec/union_spec.rb so that CI succeeds
Client: Ruby
Patch: Kengo Seki

This closes #1891
diff --git a/lib/rb/spec/union_spec.rb b/lib/rb/spec/union_spec.rb
index 0ce6306..efb3853 100644
--- a/lib/rb/spec/union_spec.rb
+++ b/lib/rb/spec/union_spec.rb
@@ -51,8 +51,7 @@
     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
 
     it "should not be equal to nil" do