diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-02-23 21:59:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 21:59:27 -0500 |
commit | bf388ecfc22d91f9716aca82cc4da5b583d87f17 (patch) | |
tree | 7cc570d870628ff261162903b8b29411732447bc /railties/test | |
parent | 09f97c1aca8d2cfddd4daa3e5a229ec0f4e23ddb (diff) | |
parent | e69a0e34494de8d91f53c0e1647690a8775a9536 (diff) | |
download | rails-bf388ecfc22d91f9716aca82cc4da5b583d87f17.tar.gz rails-bf388ecfc22d91f9716aca82cc4da5b583d87f17.tar.bz2 rails-bf388ecfc22d91f9716aca82cc4da5b583d87f17.zip |
Merge pull request #28141 from y-yagi/show_correct_help_and_version
Make version and help short-cut alias to work
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/help_test.rb | 23 | ||||
-rw-r--r-- | railties/test/application/version_test.rb | 24 |
2 files changed, 47 insertions, 0 deletions
diff --git a/railties/test/application/help_test.rb b/railties/test/application/help_test.rb new file mode 100644 index 0000000000..0c3fe8bfa3 --- /dev/null +++ b/railties/test/application/help_test.rb @@ -0,0 +1,23 @@ +require "isolation/abstract_unit" + +class HelpTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + end + + def teardown + teardown_app + end + + test "command works" do + output = Dir.chdir(app_path) { `bin/rails help` } + assert_match "The most common rails commands are", output + end + + test "short-cut alias works" do + output = Dir.chdir(app_path) { `bin/rails -h` } + assert_match "The most common rails commands are", output + end +end diff --git a/railties/test/application/version_test.rb b/railties/test/application/version_test.rb new file mode 100644 index 0000000000..6b419ae7ae --- /dev/null +++ b/railties/test/application/version_test.rb @@ -0,0 +1,24 @@ +require "isolation/abstract_unit" +require "rails/gem_version" + +class VersionTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + end + + def teardown + teardown_app + end + + test "command works" do + output = Dir.chdir(app_path) { `bin/rails version` } + assert_equal "Rails #{Rails.gem_version}\n", output + end + + test "short-cut alias works" do + output = Dir.chdir(app_path) { `bin/rails -v` } + assert_equal "Rails #{Rails.gem_version}\n", output + end +end |