diff options
author | Yoshiyuki Hirano <yhirano@me.com> | 2017-08-19 14:13:23 +0900 |
---|---|---|
committer | Yoshiyuki Hirano <yhirano@me.com> | 2017-08-19 15:04:52 +0900 |
commit | be49c302f30319cc460cd83ae0e89464dde11a37 (patch) | |
tree | c7c29145aca77a14c5b9e4f9370e876d535b517c /railties/test/generators | |
parent | 99c604f1f9de2f2a6fc3d0aec4f274cb05b48c69 (diff) | |
download | rails-be49c302f30319cc460cd83ae0e89464dde11a37.tar.gz rails-be49c302f30319cc460cd83ae0e89464dde11a37.tar.bz2 rails-be49c302f30319cc460cd83ae0e89464dde11a37.zip |
Support multiple versions arguments for `gem` method of Generators
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/actions_test.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index e2e5aec805..c015395962 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -71,10 +71,17 @@ class ActionsTest < Rails::Generators::TestCase def test_gem_with_version_should_include_version_in_gemfile run_generator - - action :gem, "rspec", ">=2.0.0.a5" - - assert_file "Gemfile", /gem 'rspec', '>=2.0.0.a5'/ + action :gem, "rspec", ">= 2.0.0.a5" + action :gem, "RedCloth", ">= 4.1.0", "< 4.2.0" + action :gem, "nokogiri", version: ">= 1.4.2" + action :gem, "faker", version: [">= 0.1.0", "< 0.3.0"] + + assert_file "Gemfile" do |content| + assert_match(/gem 'rspec', '>= 2\.0\.0\.a5'/, content) + assert_match(/gem 'RedCloth', '>= 4\.1\.0', '< 4\.2\.0'/, content) + assert_match(/gem 'nokogiri', '>= 1\.4\.2'/, content) + assert_match(/gem 'faker', '>= 0\.1\.0', '< 0\.3\.0'/, content) + end end def test_gem_should_insert_on_separate_lines |