From 9bc99b4fe5fb23f447483a3b031026cc121f2ab8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 30 Oct 2013 16:53:08 -0700 Subject: add a test for whitespace separated args in the rc file --- railties/test/generators/argv_scrubber_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'railties/test') diff --git a/railties/test/generators/argv_scrubber_test.rb b/railties/test/generators/argv_scrubber_test.rb index 56df1cec02..a94350cbd7 100644 --- a/railties/test/generators/argv_scrubber_test.rb +++ b/railties/test/generators/argv_scrubber_test.rb @@ -75,6 +75,22 @@ module Rails file.unlink end + def test_rc_whitespace_separated + file = Tempfile.new 'myrcfile' + file.puts '--hello --world' + file.flush + + message = nil + scrubber = Class.new(ARGVScrubber) { + define_method(:puts) { |msg| message = msg } + }.new ['new', "--rc=#{file.path}"] + args = scrubber.prepare! + assert_equal ['--hello', '--world'], args + ensure + file.close + file.unlink + end + def test_new_rc_option file = Tempfile.new 'myrcfile' file.puts '--hello-world' -- cgit v1.2.3