Skip to content

Commit

Permalink
Add #expect_ran test helper
Browse files Browse the repository at this point in the history
  • Loading branch information
fny committed May 10, 2015
1 parent b26a813 commit 9ac71b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/support/command_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ module CommandHelpers
def commands
CommandInterceptor.commands
end

def expect_ran(*args)
expected_name, *expected_args = args
command = commands.last
expect(command.name).to eq(expected_name)
expect(command.args).to eq(expected_args) if expected_args.any?
end
end

RSpec.configure do |config|
Expand Down

0 comments on commit 9ac71b2

Please sign in to comment.