Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
0d6007c
)
Add failing spec for sharing of default values between struct instances (THRIFT-4)
author
Kevin Clark
<kclark@apache.org>
Wed, 18 Jun 2008 01:13:37 +0000
(
01:13
+0000)
committer
Kevin Clark
<kclark@apache.org>
Wed, 18 Jun 2008 01:13:37 +0000
(
01:13
+0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668983
13f79535
-47bb-0310-9956-
ffa450edef68
lib/rb/spec/struct_spec.rb
patch
|
blob
|
history
diff --git
a/lib/rb/spec/struct_spec.rb
b/lib/rb/spec/struct_spec.rb
index
8e106fa
..
e57d555
100644
(file)
--- a/
lib/rb/spec/struct_spec.rb
+++ b/
lib/rb/spec/struct_spec.rb
@@
-36,6
+36,17
@@
class ThriftStructSpec < Spec::ExampleGroup
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