Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow truthy and falsey values to be enough in group match blocks #113

Merged
merged 3 commits into from
Mar 21, 2016

Conversation

jnunemaker
Copy link
Collaborator

Problem

Ruby general is ok with truthy and falsey values over explicitly true and false. Flipper was different and expected exactly true to be returned by the flipper group match block.

Solution

Allow truthy to work. This means that blocks that return truthy values which previously would have returned false will now return true.

Fixes #110

let(:admin_group) { flipper.group(:admins) }
let(:dev_group) { flipper.group(:devs) }
let(:truthy_group) { flipper.group(:truthy) }
let(:falsey_group) { flipper.group(:falsey) }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I don't know how your tests work, but are these two groups used anywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was going to use them and then realized I could just use admin?. I'll remove them. Good catch.

jnunemaker pushed a commit that referenced this pull request Mar 21, 2016
Allow truthy and falsey values to be enough in group match blocks
@jnunemaker jnunemaker merged commit e98f9cc into master Mar 21, 2016
@jnunemaker jnunemaker deleted the truthy branch March 21, 2016 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants