Permalink
Browse files

add a test for whitespace separated args in the rc file

  • Loading branch information...
1 parent b0645ea commit 9bc99b4fe5fb23f447483a3b031026cc121f2ab8 @tenderlove tenderlove committed Oct 30, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 railties/test/generators/argv_scrubber_test.rb
@@ -75,6 +75,22 @@ def test_new_homedir_rc
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'

0 comments on commit 9bc99b4

Please sign in to comment.