From 90364bf334d3cc1e0bf73d9026610d6ec155a864 Mon Sep 17 00:00:00 2001 From: Jason Draper Date: Fri, 13 Sep 2013 14:45:47 -0400 Subject: [PATCH] Use 1.9 style syntax --- .../active_model/comparison_matcher_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/shoulda/matchers/active_model/comparison_matcher_spec.rb b/spec/shoulda/matchers/active_model/comparison_matcher_spec.rb index 7c73d904d..4194e1ad7 100644 --- a/spec/shoulda/matchers/active_model/comparison_matcher_spec.rb +++ b/spec/shoulda/matchers/active_model/comparison_matcher_spec.rb @@ -2,46 +2,46 @@ describe Shoulda::Matchers::ActiveModel::ComparisonMatcher do context 'is_greater_than' do - it { instance_with_validations(:greater_than => 2).should matcher.is_greater_than(2) } + it { instance_with_validations(greater_than: 2).should matcher.is_greater_than(2) } it { instance_without_validations.should_not matcher.is_greater_than(2) } end context 'greater_than_or_equal_to' do - it { instance_with_validations(:greater_than_or_equal_to => 2).should matcher.is_greater_than_or_equal_to(2) } + it { instance_with_validations(greater_than_or_equal_to: 2).should matcher.is_greater_than_or_equal_to(2) } it { instance_without_validations.should_not matcher.is_greater_than_or_equal_to(2) } end context 'less_than' do - it { instance_with_validations(:less_than => 2).should matcher.is_less_than(2) } + it { instance_with_validations(less_than: 2).should matcher.is_less_than(2) } it { instance_without_validations.should_not matcher.is_less_than(2) } end context 'less_than_or_equal_to' do - it { instance_with_validations(:less_than_or_equal_to => 2).should matcher.is_less_than_or_equal_to(2) } + it { instance_with_validations(less_than_or_equal_to: 2).should matcher.is_less_than_or_equal_to(2) } it { instance_without_validations.should_not matcher.is_less_than_or_equal_to(2) } end context 'is_equal_to' do - it { instance_with_validations(:equal_to => 0).should matcher.is_equal_to(0) } + it { instance_with_validations(equal_to: 0).should matcher.is_equal_to(0) } it { instance_without_validations.should_not matcher.is_equal_to(0) } end context 'with_message' do it 'verifies the message for the validation' do - instance = instance_with_validations(:equal_to => 0, :message => 'Must be zero') + instance = instance_with_validations(equal_to: 0, message: 'Must be zero') instance.should matcher.is_equal_to(0).with_message('Must be zero') end end def instance_with_validations(options = {}) - define_model :example, :attr => :string do + define_model :example, attr: :string do validates_numericality_of :attr, options attr_accessible :attr end.new end def instance_without_validations - define_model :example, :attr => :string do + define_model :example, attr: :string do attr_accessible :attr end.new end