lib/mattock/testing/mock-command-line.rb in mattock-0.2.10 vs lib/mattock/testing/mock-command-line.rb in mattock-0.2.11
- old
+ new
@@ -32,11 +32,11 @@
end
before :each do
Mattock::CommandLine.should_receive(:execute) do |cmd|
pattern, res = pairs.shift
- pattern =~ cmd
+ pattern.should =~ cmd
Mattock::MockCommandResult.create(*res)
end.any_number_of_times
end
after :each do
@@ -44,9 +44,10 @@
end
end
end
def expect_command(cmd, *result)
+ raise ArgumentError, "Regexp expected: not #{cmd.inspect}" unless Regexp === cmd
pairs << [cmd, result]
end
module Matchers
extend RSpec::Matchers::DSL