Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adding test for humans.txt #6205

Merged
merged 1 commit into from

3 participants

@arunagw
Collaborator

added here ceb1dcc

@fxn
Owner
fxn commented

Is "Tmp" portable?

@arunagw
Collaborator

I have made a change here. Not app_const_base is using in generator.

railties/test/generators/app_generator_test.rb
@@ -383,6 +383,12 @@ def test_pretend_option
assert_no_match(/run bundle install/, output)
end
+ def test_humans_txt_file
+ output = run_generator [File.join(destination_root, 'things-43')]
+ assert_file "things-43/public/humans.txt", /Things43/
+ assert_file "things-43/public/humans.txt", /Software: Ruby on Rails/

I think you can assert_file only once, with more assertions:

assert_file "things-43/public/humans.txt", /Things43/, /Software: Ruby on Rails/
@arunagw Collaborator
arunagw added a note

Yes. thanks. Updated. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@fxn fxn merged commit 882e750 into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 8, 2012
  1. @arunagw

    Adding test for humans.txt

    arunagw authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 railties/test/generators/app_generator_test.rb
View
6 railties/test/generators/app_generator_test.rb
@@ -383,6 +383,12 @@ def test_pretend_option
assert_no_match(/run bundle install/, output)
end
+ def test_humans_txt_file
+ date = Date.today.strftime("%B %d, %Y")
+ run_generator [File.join(destination_root, 'things-43')]
+ assert_file "things-43/public/humans.txt", /Name: Things43/, /Software: Ruby on Rails/, /Date Created: #{date}/
+ end
+
protected
def action(*args, &block)
Something went wrong with that request. Please try again.