From 9ac71b2bdcc660dc9bf95fd9fd630d8981dbd411 Mon Sep 17 00:00:00 2001 From: Faraz Yashar Date: Fri, 8 May 2015 20:22:42 -0400 Subject: [PATCH] Add #expect_ran test helper --- spec/support/command_helpers.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/support/command_helpers.rb b/spec/support/command_helpers.rb index 57f74f1..5c1e2d4 100644 --- a/spec/support/command_helpers.rb +++ b/spec/support/command_helpers.rb @@ -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|