Sha256: 5ede805add9b937a7cdb65dac91c427303524c8975fb42e7de114eae61ffee6e
Contents?: true
Size: 926 Bytes
Versions: 2
Compression:
Stored size: 926 Bytes
Contents
require 'spec_helper' require 'gorillib/model/lint' describe Gorillib::Model::Lint, :model_spec => true do subject do klass = Class.new{ include Gorillib::Model ; include Gorillib::Model::Lint ; field :bob, Integer } klass.new end context '#read_attribute' do it "raises an error if the field does not exist" do ->{ subject.read_attribute(:fnord) }.should raise_error(Gorillib::Model::UnknownFieldError, /unknown field: fnord/) end end context '#write_attribute' do it "raises an error if the field does not exist" do ->{ subject.write_attribute(:fnord, 8) }.should raise_error(Gorillib::Model::UnknownFieldError, /unknown field: fnord/) end end context '#attribute_set?' do it "raises an error if the field does not exist" do ->{ subject.attribute_set?(:fnord) }.should raise_error(Gorillib::Model::UnknownFieldError, /unknown field: fnord/) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gorillib-model-0.0.3 | spec/model/lint_spec.rb |
gorillib-model-0.0.1 | spec/model/lint_spec.rb |