Permalink
Browse files

change the test to make argv a little more realistic

  • Loading branch information...
1 parent 7d01907 commit 169fa516c3178077eb9a35fa757063de936be53c @tenderlove tenderlove committed Oct 30, 2013
Showing with 6 additions and 7 deletions.
  1. +6 −7 railties/test/generators/argv_scrubber_test.rb
@@ -84,17 +84,16 @@ def test_new_rc_option
def test_new_rc_option_and_custom_options
file = Tempfile.new 'myrcfile'
- file.puts '--hello-world'
+ file.puts '--hello'
+ file.puts '--world'
file.flush
- message = nil
scrubber = Class.new(ARGVScrubber) {
- define_method(:puts) { |msg| message = msg }
- }.new ['new', '--tender', '--love', "--rc=#{file.path}"]
+ define_method(:puts) { |msg| }
+ }.new ['new', 'tenderapp', '--love', "--rc=#{file.path}"]
+
args = scrubber.prepare!
- assert_equal ['--tender', '--hello-world', '--love'], args
- assert_match 'hello-world', message
- assert_match file.path, message
+ assert_equal ["tenderapp", "--hello", "--world", "--love"], args
ensure
file.close
file.unlink

0 comments on commit 169fa51

Please sign in to comment.