Sha256: 73ddfbfb50d56d0092aff49da0902822cd4cfb8d6841154edc1ac3439f11e3ac
Contents?: true
Size: 1.09 KB
Versions: 6
Compression:
Stored size: 1.09 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
6 entries across 6 versions & 1 rubygems