Sha256: 5dc3752a52e819c223e745f526e9c0c20c2f8fa75bded27c56948fbd2ec122d4

Contents?: true

Size: 844 Bytes

Versions: 19

Compression:

Stored size: 844 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
        @obj.last_name.should == nil
      end
    
      it "should set on constructor" do
        obj = Appstats::TestObject.new(:name => 'a', :last_name => 'b')
        obj.name.should == 'a'
        obj.last_name.should == 'b'
      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

19 entries across 19 versions & 1 rubygems

Version Path
appstats-0.25.1 spec/test_object_spec.rb
appstats-0.25.0 spec/test_object_spec.rb
appstats-0.24.0 spec/test_object_spec.rb
appstats-0.23.5 spec/test_object_spec.rb
appstats-0.23.4 spec/test_object_spec.rb
appstats-0.23.3 spec/test_object_spec.rb
appstats-0.23.2 spec/test_object_spec.rb
appstats-0.23.1 spec/test_object_spec.rb
appstats-0.23.0 spec/test_object_spec.rb
appstats-0.22.6 spec/test_object_spec.rb
appstats-0.22.5 spec/test_object_spec.rb
appstats-0.22.4 spec/test_object_spec.rb
appstats-0.22.3 spec/test_object_spec.rb
appstats-0.22.2 spec/test_object_spec.rb
appstats-0.22.1 spec/test_object_spec.rb
appstats-0.22.0 spec/test_object_spec.rb
appstats-0.21.3 spec/test_object_spec.rb
appstats-0.21.2 spec/test_object_spec.rb
appstats-0.21.1 spec/test_object_spec.rb