Sha256: 5ea9bd429a2cc0d8c1f74a9e64b2e5271bacd9de8281de1a4f70dcd78154b999

Contents?: true

Size: 579 Bytes

Versions: 8

Compression:

Stored size: 579 Bytes

Contents

require 'helper'

describe Toy::Attributes do
  uses_objects('User')

  before do
    User.attribute(:name, String)
    User.attribute(:age, Integer)
  end

  describe ".inspect" do
    it "prints out attribute names and types" do
      User.inspect.should == %Q(User(id:String age:Integer name:String))
    end
  end

  describe "#inspect" do
    it "prints out object id and attributes sorted with values" do
      user = User.new(:age => 28, :name => 'John')
      user.inspect.should == %Q(#<User:#{user.object_id} id: "#{user.id}", age: 28, name: "John">)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
toystore-0.13.0 spec/toy/inspect_spec.rb
toystore-0.12.0 spec/toy/inspect_spec.rb
toystore-0.11.0 spec/toy/inspect_spec.rb
toystore-0.10.4 spec/toy/inspect_spec.rb
toystore-0.10.3 spec/toy/inspect_spec.rb
toystore-0.10.2 spec/toy/inspect_spec.rb
toystore-0.10.1 spec/toy/inspect_spec.rb
toystore-0.10.0 spec/toy/inspect_spec.rb