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

Implement exclusive mode in be_between #412

Merged
merged 9 commits into from Jan 8, 2014

Conversation

Projects
None yet
5 participants
@pedrogimenez
Contributor

pedrogimenez commented Jan 6, 2014

No description provided.

@pedrogimenez

This comment has been minimized.

Show comment
Hide comment
@pedrogimenez

pedrogimenez Jan 7, 2014

Contributor

Hey, @myronmarston and @sferik could you take a look? ✌️

Contributor

pedrogimenez commented Jan 7, 2014

Hey, @myronmarston and @sferik could you take a look? ✌️

@less_than_operator = :<
@greater_than_operator = :>
@mode = :exclusive
self
end

This comment has been minimized.

@myronmarston

myronmarston Jan 7, 2014

Member

I'm thinking that it would be good to add an inclusive method as well. be_between would remain inclusive by default; the method would just be a way for users to make that explicit if/when they want to. You could move the ivar assignments out of initialize into inclusive, and then call inclusive from initialize -- that would have a nice side benefit of telling a more clear story as well.

@myronmarston

myronmarston Jan 7, 2014

Member

I'm thinking that it would be good to add an inclusive method as well. be_between would remain inclusive by default; the method would just be a way for users to make that explicit if/when they want to. You could move the ivar assignments out of initialize into inclusive, and then call inclusive from initialize -- that would have a nice side benefit of telling a more clear story as well.

This comment has been minimized.

@pedrogimenez

pedrogimenez Jan 7, 2014

Contributor

Sounds good. It's more idiomatic 👍

@pedrogimenez

pedrogimenez Jan 7, 2014

Contributor

Sounds good. It's more idiomatic 👍

@myronmarston

This comment has been minimized.

Show comment
Hide comment
@myronmarston

myronmarston Jan 7, 2014

Member

@pedrogimenez -- this is looking great. Left a few more comments, but this is almost ready to merge.

Member

myronmarston commented Jan 7, 2014

@pedrogimenez -- this is looking great. Left a few more comments, but this is almost ready to merge.

@pedrogimenez

This comment has been minimized.

Show comment
Hide comment
@pedrogimenez

pedrogimenez Jan 7, 2014

Contributor

Hey @myronmarston, have a look at the code!

Contributor

pedrogimenez commented Jan 7, 2014

Hey @myronmarston, have a look at the code!

end
it 'works with other Comparable objects' do
module RSpec::Matchers::BuiltIn

This comment has been minimized.

@pedrogimenez

pedrogimenez Jan 7, 2014

Contributor

I don't like this style but I don't like having three indentation levels either.

@pedrogimenez

pedrogimenez Jan 7, 2014

Contributor

I don't like this style but I don't like having three indentation levels either.

JonRowe added a commit that referenced this pull request Jan 8, 2014

Merge pull request #412 from pedrogimenez/be_between_exclusive
Implement exclusive mode in be_between

@JonRowe JonRowe merged commit fc697d0 into rspec:master Jan 8, 2014

1 check passed

default The Travis CI build passed
Details
@JonRowe

This comment has been minimized.

Show comment
Hide comment
@JonRowe

JonRowe Jan 8, 2014

Member

Thanks for the work on this!

Member

JonRowe commented Jan 8, 2014

Thanks for the work on this!

JonRowe added a commit that referenced this pull request Jan 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment