Skip to content

Commit

Permalink
test: pass a hash as intended, not a block
Browse files Browse the repository at this point in the history
Ruby is readable, except when it is not.

This fixes
     Failure/Error: expect(Yast::SCR).
     ArgumentError:
       wrong number of arguments (0 for 1+)
which is quite cryptic. Running rspec -b/--backtrace reveals the problem
is in and_return.

This probably broke only with RSpec3.
  • Loading branch information
mvidner committed Sep 3, 2014
1 parent 01d238c commit e6f7d9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/network_autoconfiguration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ def set(section, key, value)
expect(Yast::SCR).
to receive(:Read).
with(Yast::Path.new(".udev_persistent.net")).
and_return {}
and_return({})
expect(Yast::SCR).
to receive(:Read).
with(Yast::Path.new(".udev_persistent.drivers")).
and_return {}
and_return({})
end

it "configures just one NIC to have a default route" do
Expand Down

0 comments on commit e6f7d9c

Please sign in to comment.