Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Fix #attribute_provided? behavior #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix #attribute_provided? behavior #23

wants to merge 1 commit into from

Conversation

wwwwhiterabbit
Copy link

#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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant