You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by kc...@apache.org on 2008/06/18 03:13:38 UTC
svn commit: r668983 - /incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
Author: kclark
Date: Tue Jun 17 18:13:37 2008
New Revision: 668983
URL: http://svn.apache.org/viewvc?rev=668983&view=rev
Log:
Add failing spec for sharing of default values between struct instances (THRIFT-4)
Modified:
incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
Modified: incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/struct_spec.rb?rev=668983&r1=668982&r2=668983&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/struct_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/struct_spec.rb Tue Jun 17 18:13:37 2008
@@ -36,6 +36,17 @@
struct.shorts.should == Set.new([5, 17, 239])
end
+ it "should not share default values between instances" do
+ begin
+ struct = Foo.new
+ struct.ints << 17
+ Foo.new.ints.should == [1,2,2,3]
+ ensure
+ # ensure no leakage to other tests
+ Foo::FIELDS[4][:default] = [1,2,2,3]
+ end
+ end
+
it "should have proper == semantics" do
Foo.new.should_not == Hello.new
Foo.new.should == Foo.new