Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ojab authored and mcmire committed Jan 28, 2016
1 parent 9822760 commit 1dbf71b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/shoulda/matchers/active_model/allow_value_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def attribute_setters_and_validators_for_values_to_set
def inspected_values_to_set
Shoulda::Matchers::Util.inspect_values(values_to_set).to_sentence(
two_words_connector: " or ",
last_word_connector: ", or"
last_word_connector: ", or "
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@

describe Shoulda::Matchers::ActiveModel::AllowValueMatcher, type: :model do
context "#description" do
it 'describes itself with multiple values' do
it 'describes itself with two values' do
matcher = allow_value('foo', 'bar').for(:baz)

expect(matcher.description).to eq(
'allow :baz to be ‹"foo"› or ‹"bar"›'
)
end

it 'describes itself with more than two values' do
matcher = allow_value('foo', 'bar', 'qux').for(:baz)

expect(matcher.description).to eq(
'allow :baz to be ‹"foo"›, ‹"bar"›, or ‹"qux"›'
)
end

it 'describes itself with a single value' do
matcher = allow_value('foo').for(:baz)

Expand Down

0 comments on commit 1dbf71b

Please sign in to comment.