rspec-bash 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -0
  3. data/Gemfile +1 -0
  4. data/README.md +23 -0
  5. data/Rakefile +15 -4
  6. data/bin/bash_stub.sh +92 -0
  7. data/bin/bash_wrapper.sh.erb +12 -0
  8. data/bin/ruby_stub.rb +33 -0
  9. data/lib/rspec/bash.rb +5 -4
  10. data/lib/rspec/bash/command.rb +5 -0
  11. data/lib/rspec/bash/command/call_configuration.rb +76 -0
  12. data/lib/rspec/bash/command/call_configuration_manager.rb +24 -0
  13. data/lib/rspec/bash/command/call_log.rb +48 -0
  14. data/lib/rspec/bash/command/call_log_manager.rb +38 -0
  15. data/lib/rspec/bash/command/stubbed_command.rb +64 -0
  16. data/lib/rspec/bash/server.rb +3 -0
  17. data/lib/rspec/bash/server/bash_stub_marshaller.rb +19 -0
  18. data/lib/rspec/bash/server/ruby_stub_marshaller.rb +13 -0
  19. data/lib/rspec/bash/server/stub_server.rb +47 -0
  20. data/lib/rspec/bash/stubbed_env.rb +75 -54
  21. data/lib/rspec/bash/util/call_conf_argument_list_matcher.rb +5 -5
  22. data/lib/rspec/bash/util/call_log_argument_list_matcher.rb +1 -1
  23. data/lib/rspec/bash/wrapper.rb +4 -0
  24. data/lib/rspec/bash/wrapper/bash_stub_script.rb +15 -0
  25. data/lib/rspec/bash/wrapper/bash_wrapper.rb +54 -0
  26. data/lib/rspec/bash/wrapper/ruby_stub_script.rb +15 -0
  27. data/lib/rspec/bash/wrapper/stub_function.rb +36 -0
  28. data/rspec-bash.gemspec +2 -1
  29. data/spec/classes/command/call_configuration_manager_spec.rb +68 -0
  30. data/spec/classes/{call_configuration_spec.rb → command/call_configuration_spec.rb} +51 -114
  31. data/spec/classes/command/call_log_manager_spec.rb +83 -0
  32. data/spec/classes/{call_log_spec.rb → command/call_log_spec.rb} +23 -82
  33. data/spec/classes/command/stubbed_command_spec.rb +118 -0
  34. data/spec/classes/server/bash_stub_marshaller_spec.rb +38 -0
  35. data/spec/classes/server/ruby_stub_marshaller_spec.rb +31 -0
  36. data/spec/classes/server/stub_server_spec.rb +121 -0
  37. data/spec/classes/stubbed_env_spec.rb +141 -280
  38. data/spec/classes/util/call_conf_argument_list_matcher_spec.rb +17 -17
  39. data/spec/classes/util/call_log_argument_list_matcher_spec.rb +24 -18
  40. data/spec/classes/wrapper/bash_wrapper_spec.rb +37 -0
  41. data/spec/classes/wrapper/ruby_stub_script_spec.rb +204 -0
  42. data/spec/helper/string_file_io.rb +1 -1
  43. data/spec/integration/call_log/called_with_args_spec.rb +8 -4
  44. data/spec/integration/call_log/called_with_no_args_spec.rb +1 -1
  45. data/spec/integration/call_log/stdin_spec.rb +10 -4
  46. data/spec/integration/edge_cases_spec.rb +34 -0
  47. data/spec/integration/matchers/be_called_with_arguments_spec.rb +12 -13
  48. data/spec/integration/matchers/be_called_with_no_arguments_spec.rb +6 -7
  49. data/spec/integration/stubbed_command/outputs_spec.rb +111 -91
  50. data/spec/integration/stubbed_command/returns_exitstatus_spec.rb +46 -37
  51. data/spec/integration/stubbed_env/execute_with_env_vars_spec.rb +3 -4
  52. data/spec/integration/stubbed_env/execute_with_path_spec.rb +6 -7
  53. data/spec/integration/stubbed_env/execute_with_stub_wrapper_spec.rb +4 -12
  54. data/spec/integration/stubbed_env/override_spec.rb +354 -0
  55. data/spec/integration/wrapper/bash_stub_script_spec.rb +383 -0
  56. data/spec/integration/wrapper/bash_wrapper_spec.rb +48 -0
  57. data/spec/scripts/function_library.sh +9 -1
  58. data/spec/spec_helper.rb +2 -0
  59. metadata +65 -21
  60. data/bin/function_override.sh.erb +0 -7
  61. data/bin/function_override_wrapper.sh.erb +0 -19
  62. data/bin/stub.rb.erb +0 -56
  63. data/lib/rspec/bash/call_configuration.rb +0 -62
  64. data/lib/rspec/bash/call_log.rb +0 -71
  65. data/lib/rspec/bash/stubbed_command.rb +0 -88
  66. data/spec/classes/stub_spec.rb +0 -510
  67. data/spec/classes/stubbed_command_spec.rb +0 -134
  68. data/spec/integration/assert_called_spec.rb +0 -0
@@ -1,300 +1,161 @@
1
1
  require 'spec_helper'
2
+ include Rspec::Bash
2
3
 
3
4
  describe 'StubbedEnv' do
4
- include Rspec::Bash
5
- let(:subject) { Rspec::Bash::StubbedEnv.new }
6
-
7
- context '#execute_inline' do
8
- context 'with a stubbed function' do
9
- before(:each) do
10
- @overridden_function = subject.stub_command('overridden_function')
11
- @overridden_command = subject.stub_command('overridden_command')
12
- @overridden_function.outputs('i was overridden')
13
- end
14
-
15
- context 'and no arguments' do
16
- before(:each) do
17
- @stdout, @stderr, @status = subject.execute_inline(
18
- <<-multiline_script
19
- #!/usr/bin/env bash
20
- function overridden_function {
21
- echo 'i was not overridden'
22
- }
23
- overridden_function
24
-
25
- echo 'standard error output' 1>&2
26
- multiline_script
27
- )
28
- end
29
-
30
- it 'calls the stubbed function' do
31
- expect(@overridden_function).to be_called
32
- end
33
-
34
- it 'prints the overridden output' do
35
- expect(@stdout).to eql('i was overridden')
36
- end
37
-
38
- it 'prints provided stderr output to standard error' do
39
- expect(@stderr).to eql("standard error output\n")
40
- end
41
- end
42
-
43
- context 'and simple arguments' do
44
- before(:each) do
45
- @stdout, @stderr, @status = subject.execute_inline(
46
- <<-multiline_script
47
- #!/usr/bin/env bash
48
- function overridden_function {
49
- echo 'i was not overridden'
50
- }
51
- overridden_function argument_one argument_two
52
-
53
- echo 'standard error output' 1>&2
54
- multiline_script
55
- )
56
- end
57
-
58
- it 'calls the stubbed function' do
59
- expect(@overridden_function).to be_called_with_arguments('argument_one', 'argument_two')
60
- end
61
-
62
- it 'prints the overridden output' do
63
- expect(@stdout).to eql('i was overridden')
64
- end
65
- end
66
-
67
- context 'and complex arguments (spaces, etc.)' do
68
- before(:each) do
69
- @stdout, @stderr, @status = subject.execute_inline(
70
- <<-multiline_script
71
- #!/usr/bin/env bash
72
- function overridden_function {
73
- echo 'i was not overridden'
74
- }
75
- overridden_function "argument one" "argument two"
76
-
77
- echo 'standard error output' 1>&2
78
- multiline_script
79
- )
80
- end
81
-
82
- it 'calls the stubbed function' do
83
- expect(@overridden_function).to be_called_with_arguments('argument one', 'argument two')
84
- end
85
-
86
- it 'prints the overridden output' do
87
- expect(@stdout).to eql('i was overridden')
88
- end
89
- end
90
- end
91
- context 'with a stubbed command' do
92
- before(:each) do
93
- @overridden_command = subject.stub_command('overridden_command')
94
- @overridden_function = subject.stub_command('overridden_function')
95
- @overridden_command.outputs('i was overridden')
96
- end
97
-
98
- context 'and no arguments' do
99
- before(:each) do
100
- @stdout, @stderr, @status = subject.execute_inline(
101
- <<-multiline_script
102
- #!/usr/bin/env bash
103
- overridden_command
104
- multiline_script
105
- )
106
- end
107
-
108
- it 'calls the stubbed command' do
109
- expect(@overridden_command).to be_called
110
- end
111
-
112
- it 'prints the overridden output' do
113
- expect(@stdout).to eql('i was overridden')
114
- end
115
- end
116
-
117
- context 'and simple arguments' do
118
- before(:each) do
119
- @stdout, @stderr, @status = subject.execute_inline(
120
- <<-multiline_script
121
- #!/usr/bin/env bash
122
- overridden_command argument_one argument_two
123
- multiline_script
124
- )
125
- end
126
-
127
- it 'calls the stubbed command' do
128
- expect(@overridden_command).to be_called_with_arguments('argument_one', 'argument_two')
129
- end
5
+ subject { StubbedEnv.new(StubbedEnv::RUBY_STUB) }
6
+ let(:server_thread) { double(Thread) }
7
+ let(:server_port) { 4000 }
8
+ let!(:tcp_server) do
9
+ tcp_server = double(TCPServer)
10
+ allow(tcp_server).to receive(:addr)
11
+ .and_return(['ADDR', server_port])
12
+ allow(TCPServer).to receive(:new)
13
+ .with('localhost', 0)
14
+ .and_return(tcp_server)
15
+ tcp_server
16
+ end
17
+ let!(:log_manager) do
18
+ log_manager = double(CallLogManager)
19
+ allow(CallLogManager).to receive(:new)
20
+ .and_return(log_manager)
21
+ log_manager
22
+ end
23
+ let!(:conf_manager) do
24
+ conf_manager = double(CallConfigurationManager)
25
+ allow(CallConfigurationManager).to receive(:new)
26
+ .and_return(conf_manager)
27
+ conf_manager
28
+ end
29
+ let!(:stub_marshaller) do
30
+ stub_marshaller = double(RubyStubMarshaller)
31
+ allow(RubyStubMarshaller).to receive(:new)
32
+ .and_return(stub_marshaller)
33
+ stub_marshaller
34
+ end
35
+ let!(:stub_server) do
36
+ stub_server = double(StubServer)
37
+ allow(stub_server).to receive(:start)
38
+ .and_return(server_thread)
39
+ allow(StubServer).to receive(:new)
40
+ .with(log_manager, conf_manager, stub_marshaller)
41
+ .and_return(stub_server)
42
+ stub_server
43
+ end
44
+ let!(:stub_wrapper) do
45
+ stub_wrapper = double(BashWrapper)
46
+ allow(BashWrapper).to receive(:new)
47
+ .and_return(stub_wrapper)
48
+ allow(stub_wrapper).to receive(:add_override)
49
+ stub_wrapper
50
+ end
130
51
 
131
- it 'prints the overridden output' do
132
- expect(@stdout).to eql('i was overridden')
133
- end
134
- end
52
+ context '#initialize' do
53
+ it 'creates and starts a StubServer' do
54
+ allow(server_thread).to receive(:kill)
135
55
 
136
- context 'and complex arguments (spaces, etc.)' do
137
- before(:each) do
138
- @stdout, @stderr, @status = subject.execute_inline(
139
- <<-multiline_script
140
- #!/usr/bin/env bash
141
- overridden_command "argument one" "argument two"
142
- multiline_script
143
- )
144
- end
56
+ expect(StubServer).to receive(:new)
57
+ .with(log_manager, conf_manager, stub_marshaller)
58
+ .and_return(stub_server)
145
59
 
146
- it 'calls the stubbed command' do
147
- expect(@overridden_command).to be_called_with_arguments('argument one', 'argument two')
148
- end
60
+ expect(stub_server).to receive(:start)
61
+ .with(tcp_server)
149
62
 
150
- it 'prints the overridden output' do
151
- expect(@stdout).to eql('i was overridden')
152
- end
153
- end
63
+ StubbedEnv.new(StubbedEnv::RUBY_STUB)
154
64
  end
155
65
  end
156
-
157
- context '#execute_function' do
158
- context 'with a stubbed function' do
159
- before(:each) do
160
- @overridden_function = subject.stub_command('overridden_function')
161
- @overridden_command = subject.stub_command('overridden_command')
162
- @overridden_function.outputs('i was overridden')
163
- @overridden_function.outputs('standard error output', to: :stderr)
164
- end
165
-
166
- context 'and no arguments' do
167
- before(:each) do
168
- @stdout, @stderr, @status = subject.execute_function(
169
- './spec/scripts/function_library.sh',
170
- 'overridden_function'
171
- )
172
- end
173
-
174
- it 'calls the stubbed function' do
175
- expect(@overridden_function).to be_called
176
- end
177
-
178
- it 'prints the overridden output' do
179
- expect(@stdout).to eql('i was overridden')
180
- end
181
-
182
- it 'prints provided stderr output to standard error' do
183
- expect(@stderr).to eql("standard error output\n")
184
- end
185
- end
186
-
187
- context 'and simple arguments' do
188
- before(:each) do
189
- @stdout, @stderr, @status = subject.execute_function(
190
- './spec/scripts/function_library.sh',
191
- 'overridden_function argument_one argument_two'
192
- )
193
- end
194
-
195
- it 'calls the stubbed function' do
196
- expect(@overridden_function).to be_called_with_arguments('argument_one', 'argument_two')
197
- end
198
-
199
- it 'prints the overridden output' do
200
- expect(@stdout).to eql('i was overridden')
201
- end
202
- end
203
-
204
- context 'and complex arguments (spaces, etc.)' do
205
- before(:each) do
206
- @stdout, @stderr, @status = subject.execute_function(
207
- './spec/scripts/function_library.sh',
208
- 'overridden_function "argument one" "argument two"'
209
- )
210
- end
211
-
212
- it 'calls the stubbed function' do
213
- expect(@overridden_function).to be_called_with_arguments('argument one', 'argument two')
214
- end
215
-
216
- it 'prints the overridden output' do
217
- expect(@stdout).to eql('i was overridden')
218
- end
219
- end
66
+ context '#stub_command' do
67
+ let!(:stub_command) do
68
+ stub_command = double(StubbedCommand)
69
+ allow(StubbedCommand).to receive(:new)
70
+ .and_return(stub_command)
71
+ stub_command
72
+ end
73
+ before do
74
+ stub_function = double(StubFunction)
75
+
76
+ allow(stub_function).to receive(:script)
77
+ .with('first_command')
78
+ .and_return('first_command override')
79
+ allow(stub_function).to receive(:script)
80
+ .with('second_command')
81
+ .and_return('second_command override')
82
+
83
+ allow(StubFunction).to receive(:new)
84
+ .and_return(stub_function)
220
85
  end
221
- context 'with a stubbed command' do
222
- before(:each) do
223
- @overridden_function = subject.stub_command('overridden_function')
224
- @overridden_command = subject.stub_command('overridden_command')
225
- @overridden_command.outputs('i was overridden')
226
- end
227
-
228
- context 'and no arguments' do
229
- before(:each) do
230
- @stdout, @stderr, @status = subject.execute_function(
231
- './spec/scripts/function_library.sh',
232
- 'overridden_command_function'
233
- )
234
- end
235
-
236
- it 'calls the stubbed command' do
237
- expect(@overridden_command).to be_called
238
- end
239
-
240
- it 'prints the overridden output' do
241
- expect(@stdout).to eql('i was overridden')
242
- end
243
-
244
- it 'prints provided stderr output to standard error' do
245
- expect(@stderr).to eql("standard error output\n")
246
- end
247
- end
248
-
249
- context 'and simple arguments' do
250
- before(:each) do
251
- @stdout, @stderr, @status = subject.execute_function(
252
- './spec/scripts/function_library.sh',
253
- 'overridden_command_function argument_one argument_two'
254
- )
255
- end
256
-
257
- it 'calls the stubbed command' do
258
- expect(@overridden_command).to be_called_with_arguments('argument_one', 'argument_two')
259
- end
260
-
261
- it 'prints the overridden output' do
262
- expect(@stdout).to eql('i was overridden')
263
- end
264
- end
265
-
266
- context 'and complex arguments (spaces, etc.)' do
267
- before(:each) do
268
- @stdout, @stderr, @status = subject.execute_function(
269
- './spec/scripts/function_library.sh',
270
- 'overridden_command_function "argument one" "argument two"'
271
- )
272
- end
273
86
 
274
- it 'calls the stubbed command' do
275
- expect(@overridden_command).to be_called_with_arguments('argument one', 'argument two')
276
- end
87
+ it 'adds the call conf and log managers to the command' do
88
+ expect(StubbedCommand).to receive(:new)
89
+ .with('first_command', log_manager, conf_manager)
277
90
 
278
- it 'prints the overridden output' do
279
- expect(@stdout).to eql('i was overridden')
280
- end
91
+ command = subject.stub_command('first_command')
92
+ expect(command).to equal(stub_command)
93
+ end
94
+ it 'adds the function override for the command to the wrapper' do
95
+ expect(stub_wrapper).to receive(:add_override)
96
+ .with('first_command override')
97
+ expect(stub_wrapper).to receive(:add_override)
98
+ .with('second_command override')
99
+
100
+ subject.stub_command('first_command')
101
+ subject.stub_command('second_command')
102
+ end
103
+ disallowed_commands = %w(/usr/bin/env bash readonly function)
104
+ disallowed_commands.each do |command|
105
+ it "does not allow #{command}" do
106
+ expect { subject.stub_command(command) }.to raise_error(
107
+ "Not able to stub command #{command}. Reserved for use by test wrapper."
108
+ )
281
109
  end
282
110
  end
283
111
  end
284
-
285
- describe 'creating a stubbed env' do
286
- it 'creates a folder to place the stubbed commands in' do
287
- env = create_stubbed_env
288
- expect(Pathname.new(env.dir)).to exist
289
- expect(Pathname.new(env.dir)).to be_directory
112
+ context '#execute' do
113
+ it 'wraps the file to execute and sends it to Open3' do
114
+ allow(stub_wrapper).to receive(:wrap_script)
115
+ .with('source file_to_execute')
116
+ .and_return('wrapped script')
117
+ expect(Open3).to receive(:capture3)
118
+ .with({ 'DOG' => 'cat' }, 'wrapped script')
119
+
120
+ subject.execute('file_to_execute', 'DOG' => 'cat')
290
121
  end
291
122
  end
292
-
293
- describe '#cleanup' do
294
- it 'removes the folder with stubbed commands' do
295
- env = create_stubbed_env
296
- env.cleanup
297
- expect(Pathname.new(env.dir)).not_to exist
123
+ context('#execute_function') do
124
+ it 'wraps the file to execute and sends it to Open3' do
125
+ allow(stub_wrapper).to receive(:wrap_script)
126
+ .with("source file_to_execute\nfunction_to_execute")
127
+ .and_return('wrapped script')
128
+ expect(Open3).to receive(:capture3)
129
+ .with({ 'DOG' => 'cat' }, 'wrapped script')
130
+
131
+ subject.execute_function('file_to_execute', 'function_to_execute', 'DOG' => 'cat')
132
+ end
133
+ end
134
+ context '#execute_inline' do
135
+ before do
136
+ tempfile = double(Tempfile)
137
+ allow(tempfile).to receive(:path)
138
+ .and_return('file_to_execute')
139
+ allow(Tempfile).to receive(:new)
140
+ .with('inline-')
141
+ .and_return(tempfile)
142
+ allow(stub_wrapper).to receive(:wrap_script)
143
+ allow(Open3).to receive(:capture3)
144
+ end
145
+ it 'puts the inline script into a file' do
146
+ expect(File).to receive(:write)
147
+ .with('file_to_execute', 'inline script to execute')
148
+ expect(File).to receive(:delete)
149
+ .with('file_to_execute')
150
+ subject.execute_inline('inline script to execute', 'DOG' => 'cat')
151
+ end
152
+ it 'wraps the file to execute and sends it to Open3' do
153
+ allow(stub_wrapper).to receive(:wrap_script)
154
+ .with('source file_to_execute')
155
+ .and_return('wrapped script')
156
+ expect(Open3).to receive(:capture3)
157
+ .with({ 'DOG' => 'cat' }, 'wrapped script')
158
+ subject.execute_inline('inline script to execute', 'DOG' => 'cat')
298
159
  end
299
160
  end
300
161
  end
@@ -122,21 +122,21 @@ describe 'CallConfArgumentListMatcher' do
122
122
  it 'returns the longest conf match' do
123
123
  argument_list_from_call = %w(first_argument second_argument third_argument)
124
124
  subject = CallConfArgumentListMatcher.new(call_conf_list)
125
- call_conf_match = subject.get_best_call_conf(*argument_list_from_call)
125
+ call_conf_match = subject.get_best_call_conf(argument_list_from_call)
126
126
  expect(call_conf_match).to eql call_conf_list.at(2)
127
127
  end
128
128
 
129
129
  it 'returns the last longest conf match for multiple exact matches' do
130
130
  argument_list_from_call = %w(first_argument second_argument)
131
131
  subject = CallConfArgumentListMatcher.new(call_conf_list)
132
- call_conf_match = subject.get_best_call_conf(*argument_list_from_call)
132
+ call_conf_match = subject.get_best_call_conf(argument_list_from_call)
133
133
  expect(call_conf_match).to eql call_conf_list.at(5)
134
134
  end
135
135
 
136
136
  it 'returns the longest conf match for any_arg v. anything matches' do
137
137
  argument_list_from_call = %w(first_argument second_argument third_argument fourth_argument)
138
138
  subject = CallConfArgumentListMatcher.new(call_conf_list)
139
- call_conf_match = subject.get_best_call_conf(*argument_list_from_call)
139
+ call_conf_match = subject.get_best_call_conf(argument_list_from_call)
140
140
  expect(call_conf_match).to eql call_conf_list.at(6)
141
141
  end
142
142
 
@@ -146,14 +146,14 @@ describe 'CallConfArgumentListMatcher' do
146
146
  fourth_argument fifth_argument
147
147
  )
148
148
  subject = CallConfArgumentListMatcher.new(call_conf_list)
149
- call_conf_match = subject.get_best_call_conf(*argument_list_from_call)
149
+ call_conf_match = subject.get_best_call_conf(argument_list_from_call)
150
150
  expect(call_conf_match).to eql call_conf_list.at(8)
151
151
  end
152
152
 
153
153
  it 'returns the last anything match for multiple, all anything matches' do
154
154
  argument_list_from_call = %w(first_argument)
155
155
  subject = CallConfArgumentListMatcher.new(call_conf_list)
156
- call_conf_match = subject.get_best_call_conf(*argument_list_from_call)
156
+ call_conf_match = subject.get_best_call_conf(argument_list_from_call)
157
157
  expect(call_conf_match).to eql call_conf_list.at(10)
158
158
  end
159
159
  end
@@ -227,7 +227,7 @@ describe 'CallConfArgumentListMatcher' do
227
227
  argument_list_from_call =
228
228
  %w(first_argument second_argument third_argument fourth_argument fifth_argument)
229
229
  subject = CallConfArgumentListMatcher.new(call_conf_list)
230
- call_conf_match = subject.get_best_call_conf(*argument_list_from_call)
230
+ call_conf_match = subject.get_best_call_conf(argument_list_from_call)
231
231
  expect(call_conf_match).to be_empty
232
232
  end
233
233
  end
@@ -338,21 +338,21 @@ describe 'CallConfArgumentListMatcher' do
338
338
  it 'returns the correct confs for a single exact/anything argument match' do
339
339
  argument_list_from_call = %w(first_argument second_argument third_argument)
340
340
  subject = CallConfArgumentListMatcher.new(call_conf_list)
341
- call_conf_match_list = subject.get_call_conf_matches(*argument_list_from_call)
341
+ call_conf_match_list = subject.get_call_conf_matches(argument_list_from_call)
342
342
  expect(call_conf_match_list).to eql call_conf_list.values_at(1, 3, 6)
343
343
  end
344
344
 
345
345
  it 'returns the correct confs for multiple exact/anything argument matches' do
346
346
  argument_list_from_call = %w(first_argument second_argument)
347
347
  subject = CallConfArgumentListMatcher.new(call_conf_list)
348
- call_conf_match_list = subject.get_call_conf_matches(*argument_list_from_call)
348
+ call_conf_match_list = subject.get_call_conf_matches(argument_list_from_call)
349
349
  expect(call_conf_match_list).to eql call_conf_list.values_at(0, 2, 4, 6)
350
350
  end
351
351
 
352
352
  it 'returns the correct confs for the all argument match' do
353
353
  argument_list_from_call = %w(first_argument)
354
354
  subject = CallConfArgumentListMatcher.new(call_conf_list)
355
- call_conf_match_list = subject.get_call_conf_matches(*argument_list_from_call)
355
+ call_conf_match_list = subject.get_call_conf_matches(argument_list_from_call)
356
356
  expect(call_conf_match_list).to eql call_conf_list.values_at(6)
357
357
  end
358
358
 
@@ -362,7 +362,7 @@ describe 'CallConfArgumentListMatcher' do
362
362
  third_argument fourth_argument fifth_argument
363
363
  )
364
364
  subject = CallConfArgumentListMatcher.new(call_conf_list)
365
- actual_args_match = subject.get_call_conf_matches(*argument_list_from_call)
365
+ actual_args_match = subject.get_call_conf_matches(argument_list_from_call)
366
366
  expect(actual_args_match).to eql call_conf_list.values_at(6, 7, 8)
367
367
  end
368
368
  end
@@ -447,21 +447,21 @@ describe 'CallConfArgumentListMatcher' do
447
447
  it 'returns the correct confs for a single exact/anything argument match' do
448
448
  argument_list_from_call = %w(first_argument second_argument third_argument)
449
449
  subject = CallConfArgumentListMatcher.new(call_conf_list)
450
- actual_args_match = subject.args_match?(*argument_list_from_call)
450
+ actual_args_match = subject.args_match?(argument_list_from_call)
451
451
  expect(actual_args_match).to be true
452
452
  end
453
453
 
454
454
  it 'returns the correct confs for multiple exact/anything argument matches' do
455
455
  argument_list_from_call = %w(first_argument second_argument)
456
456
  subject = CallConfArgumentListMatcher.new(call_conf_list)
457
- actual_args_match = subject.args_match?(*argument_list_from_call)
457
+ actual_args_match = subject.args_match?(argument_list_from_call)
458
458
  expect(actual_args_match).to be true
459
459
  end
460
460
 
461
461
  it 'returns the correct confs for the all argument match' do
462
462
  argument_list_from_call = %w(first_argument)
463
463
  subject = CallConfArgumentListMatcher.new(call_conf_list)
464
- actual_args_match = subject.args_match?(*argument_list_from_call)
464
+ actual_args_match = subject.args_match?(argument_list_from_call)
465
465
  expect(actual_args_match).to be true
466
466
  end
467
467
  end
@@ -547,21 +547,21 @@ describe 'CallConfArgumentListMatcher' do
547
547
  it 'returns the correct confs for a single exact/anything argument match' do
548
548
  argument_list_from_call = %w(first_argument second_argument third_argument)
549
549
  subject = CallConfArgumentListMatcher.new(call_conf_list)
550
- actual_args_match = subject.args_match?(*argument_list_from_call)
550
+ actual_args_match = subject.args_match?(argument_list_from_call)
551
551
  expect(actual_args_match).to be true
552
552
  end
553
553
 
554
554
  it 'returns the correct confs for multiple exact/anything argument matches' do
555
555
  argument_list_from_call = %w(first_argument second_argument)
556
556
  subject = CallConfArgumentListMatcher.new(call_conf_list)
557
- actual_args_match = subject.args_match?(*argument_list_from_call)
557
+ actual_args_match = subject.args_match?(argument_list_from_call)
558
558
  expect(actual_args_match).to be true
559
559
  end
560
560
 
561
561
  it 'returns the correct confs for the all argument match' do
562
562
  argument_list_from_call = %w(first_argument)
563
563
  subject = CallConfArgumentListMatcher.new(call_conf_list)
564
- actual_args_match = subject.args_match?(*argument_list_from_call)
564
+ actual_args_match = subject.args_match?(argument_list_from_call)
565
565
  expect(actual_args_match).to be false
566
566
  end
567
567
 
@@ -571,7 +571,7 @@ describe 'CallConfArgumentListMatcher' do
571
571
  third_argument fourth_argument fifth_argument
572
572
  )
573
573
  subject = CallConfArgumentListMatcher.new(call_conf_list)
574
- actual_args_match = subject.args_match?(*argument_list_from_call)
574
+ actual_args_match = subject.args_match?(argument_list_from_call)
575
575
  expect(actual_args_match).to be true
576
576
  end
577
577
  end