Sha256: 96b43db7988618f8f21b761d2225016dbd96bc2322b8ebce17c97d8aaf3f401f

Contents?: true

Size: 1.08 KB

Versions: 11

Compression:

Stored size: 1.08 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe SimpleModel do
  it 'Should add a boolean setter' do
    class TestStuff < SimpleModel::Base
      has_booleans :test_boolean
    end
    TestStuff.new.methods.include?(:test_boolean).should be_true
    #a.test.should be_false
  end
  it 'Should add a boolean setter' do
    class TestStuff < SimpleModel::Base
      has_booleans :test_boolean
    end
   t =  TestStuff.new
   t.methods.include?(:test_boolean).should be_true
   t.test_boolean = true
   t.test_boolean.should be_true
    #a.test.should be_false
  end
  it 'Should add a error setter' do

    class TestStuff < SimpleModel::Base
      has_attributes :test_attr
    end
    a = TestStuff.new

    a.errors.add(:test_attr, "test")
    a.errors?.should be_true
  end
end

describe SimpleModel::Errors do
  it 'Should add a error setter' do
    class TestError
      include SimpleModel::Errors
      attr_accessor :test_attr
    end
    a = TestError.new(self)
    a.errors.add(:test_attr, "test")
    a.errors?.should be_true

    #a.test.should be_false
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
simple_model-0.2.0 spec/simple_model_spec.rb
simple_model-0.1.9 spec/simple_model_spec.rb
simple_model-0.1.8 spec/simple_model_spec.rb
simple_model-0.1.7 spec/simple_model_spec.rb
simple_model-0.1.6 spec/simple_model_spec.rb
simple_model-0.1.5 spec/simple_model_spec.rb
simple_model-0.1.4 spec/simple_model_spec.rb
simple_model-0.1.3 spec/simple_model_spec.rb
simple_model-0.1.2 spec/simple_model_spec.rb
simple_model-0.1.1 spec/simple_model_spec.rb
simple_model-0.1.0 spec/simple_model_spec.rb