Commit cc0bc87216f713df6c88a4cf0fbfc1841e6bb718
1 parent
7c7ffb05
Exists in
master
and in
29 other branches
new mocha is stricter with argument checking
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
test/unit/dates_helper_test.rb
@@ -17,22 +17,22 @@ class DatesHelperTest < ActiveSupport::TestCase | @@ -17,22 +17,22 @@ class DatesHelperTest < ActiveSupport::TestCase | ||
17 | 17 | ||
18 | should 'generate period with two dates' do | 18 | should 'generate period with two dates' do |
19 | date1 = mock | 19 | date1 = mock |
20 | - expects(:show_date).with(date1).returns('XXX') | 20 | + expects(:show_date).with(date1, false).returns('XXX') |
21 | date2 = mock | 21 | date2 = mock |
22 | - expects(:show_date).with(date2).returns('YYY') | 22 | + expects(:show_date).with(date2, false).returns('YYY') |
23 | expects(:_).with('from %{date1} to %{date2}').returns('from %{date1} to %{date2}') | 23 | expects(:_).with('from %{date1} to %{date2}').returns('from %{date1} to %{date2}') |
24 | assert_equal 'from XXX to YYY', show_period(date1, date2) | 24 | assert_equal 'from XXX to YYY', show_period(date1, date2) |
25 | end | 25 | end |
26 | 26 | ||
27 | should 'generate period with two equal dates' do | 27 | should 'generate period with two equal dates' do |
28 | date1 = mock | 28 | date1 = mock |
29 | - expects(:show_date).with(date1).returns('XXX') | 29 | + expects(:show_date).with(date1, false).returns('XXX') |
30 | assert_equal 'XXX', show_period(date1, date1) | 30 | assert_equal 'XXX', show_period(date1, date1) |
31 | end | 31 | end |
32 | 32 | ||
33 | should 'generate period with one date only' do | 33 | should 'generate period with one date only' do |
34 | date1 = mock | 34 | date1 = mock |
35 | - expects(:show_date).with(date1).returns('XXX') | 35 | + expects(:show_date).with(date1, false).returns('XXX') |
36 | assert_equal 'XXX', show_period(date1) | 36 | assert_equal 'XXX', show_period(date1) |
37 | end | 37 | end |
38 | 38 |