Skip to content

Commit 3dedbc9

Browse files
author
Ted
committed
Avoid using <<- in install_instruciton test
- Use of `<<-` with leading spaces may lead a problem, but we cannot use `<<~` introduced in ruby 2.3.0 since we should support lower versions of ruby.
1 parent 48c5988 commit 3dedbc9

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

test/instance_agent/plugins/codedeploy/install_instruction_test.rb

+5-15
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ class InstallInstructionTest < InstanceAgentTestCase
231231
context "Parsing a delete file" do
232232
context "an empty delete file" do
233233
setup do
234-
@parse_string = <<-END
235-
END
234+
@parse_string = ""
236235
end
237236

238237
should "return an empty command collection" do
@@ -243,9 +242,7 @@ class InstallInstructionTest < InstanceAgentTestCase
243242

244243
context "a single file to delete" do
245244
setup do
246-
@parse_string = <<-END
247-
test_delete_path
248-
END
245+
@parse_string = "test_delete_path\n"
249246
File.stubs(:exist?).with("test_delete_path").returns(true)
250247
end
251248

@@ -281,10 +278,7 @@ class InstallInstructionTest < InstanceAgentTestCase
281278

282279
context "multiple files to delete" do
283280
setup do
284-
@parse_string = <<-END
285-
test_delete_path
286-
another_delete_path
287-
END
281+
@parse_string = "test_delete_path\nanother_delete_path\n"
288282
File.stubs(:directory?).returns(false)
289283
File.stubs(:exist?).with("test_delete_path").returns(true)
290284
File.stubs(:exist?).with("another_delete_path").returns(true)
@@ -315,11 +309,7 @@ class InstallInstructionTest < InstanceAgentTestCase
315309

316310
context "removes mangled line at the end" do
317311
setup do
318-
@parse_string = <<-END
319-
test_delete_path
320-
another_delete_path
321-
END
322-
@parse_string << "mangled"
312+
@parse_string = "test_delete_path\nanother_delete_path\nmangled"
323313
File.stubs(:exist?).with("test_delete_path").returns(true)
324314
File.stubs(:exist?).with("another_delete_path").returns(true)
325315
end
@@ -338,7 +328,7 @@ class InstallInstructionTest < InstanceAgentTestCase
338328

339329
context "correctly determines method from file type" do
340330
setup do
341-
@parse_string = 'foo'
331+
@parse_string = "foo\n"
342332
@instruction_file = mock
343333
@instruction_file.stubs(:path).returns("test/123-cleanup")
344334
File.stubs(:open).with("test/123-cleanup", 'r').returns(@instruction_file)

0 commit comments

Comments
 (0)