tainbox icon indicating copy to clipboard operation
tainbox copied to clipboard

Fix #attribute_provided? behavior

Open wwwwhiterabbit opened this issue 5 years ago • 0 comments

#attribute_provided? should return false for attributes with default values.

class Foo
  include Tainbox

  attribute :bar, Integer
  attribute :baz, Integer, default: 0
end

foo = Foo.new

expect(foo.bar).to eq(nil)
expect(foo.attribute_provided?(:bar)).to be_falsey

expect(person.baz).to eq(0)
expect(person.attribute_provided?(:baz)).to be_falsey

wwwwhiterabbit avatar Jun 10 '19 09:06 wwwwhiterabbit