spec/refcnt_spec.rb in rubypython-0.3.2 vs spec/refcnt_spec.rb in rubypython-0.5.0

- old
+ new

@@ -13,11 +13,10 @@ end include TestConstants describe 'Reference Counting' do - before :all do RubyPython.start @sys = RubyPython.import 'sys' @sys.path.append './spec/python_helpers' @objects = RubyPython.import 'objects' @@ -25,44 +24,39 @@ after :all do RubyPython.stop end - it "is one for a new object" do + it "should be one given a new object" do pyObj = @objects.RubyPythonMockObject.new get_refcnt(pyObj).should == 1 end - it "increases when a new reference is passed into Ruby" do + it "should increase when a new reference is passed into Ruby" do pyObj = @objects.RubyPythonMockObject refcnt = get_refcnt(pyObj) pyObj2 = @objects.RubyPythonMockObject get_refcnt(pyObj).should == (refcnt + 1) end describe RubyPython::PyObject do - describe "#xIncref" do - it "increases the reference count" do + it "should increase the reference count" do pyObj = @objects.RubyPythonMockObject.new refcnt = get_refcnt(pyObj) pyObj.pObject.xIncref get_refcnt(pyObj).should == refcnt + 1 end end describe "#xDecref" do - it "decreases the reference count" do + it "should decrease the reference count" do pyObj = @objects.RubyPythonMockObject.new pyObj.pObject.xIncref refcnt = get_refcnt(pyObj) pointer = pyObj.pObject.pointer pyObj.pObject.xDecref get_refcnt(pointer).should == refcnt - 1 end end - end - - end -