Sha256: b664418cb3288861e0a38012870402957f08e59cbf5ea82a917a8054ef3c28ac

Contents?: true

Size: 752 Bytes

Versions: 58

Compression:

Stored size: 752 Bytes

Contents

require 'spec_helper'

module Appstats
  describe TestObject do

    before(:each) do
      @obj = Appstats::TestObject.new
    end

    describe "#initialize" do
    
      it "should set name to nil" do
        @obj.name.should == nil
      end
    
      it "should set on constructor" do
        obj = Appstats::TestObject.new(:name => 'a')
        obj.name.should == 'a'
      end
    
    end
    
    describe "#to_s" do
      
      it "should support nil" do
        obj = Appstats::TestObject.new
        obj.to_s.should == "NILL"
        obj.name = ""
        obj.to_s.should == "[]"
      end
      
      it "should display the name" do
        Appstats::TestObject.new(:name => 'x').to_s.should == '[x]'
      end
      
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
appstats-0.20.12 spec/test_object_spec.rb
appstats-0.20.11 spec/test_object_spec.rb
appstats-0.20.10 spec/test_object_spec.rb
appstats-0.20.9 spec/test_object_spec.rb
appstats-0.20.8 spec/test_object_spec.rb
appstats-0.20.7 spec/test_object_spec.rb
appstats-0.20.6 spec/test_object_spec.rb
appstats-0.20.2 spec/test_object_spec.rb
appstats-0.20.1 spec/test_object_spec.rb
appstats-0.20.0 spec/test_object_spec.rb
appstats-0.19.7 spec/test_object_spec.rb
appstats-0.19.6 spec/test_object_spec.rb
appstats-0.19.2 spec/test_object_spec.rb
appstats-0.19.1 spec/test_object_spec.rb
appstats-0.19.0 spec/test_object_spec.rb
appstats-0.18.0 spec/test_object_spec.rb
appstats-0.17.5 spec/test_object_spec.rb
appstats-0.17.4 spec/test_object_spec.rb
appstats-0.17.3 spec/test_object_spec.rb
appstats-0.17.2 spec/test_object_spec.rb