diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-02-08 11:20:10 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-04-03 15:45:27 +0200 |
commit | f069ac2156e3822904c75a140d6012dd867f3521 (patch) | |
tree | ce712fa722fe02969524686b42c84355eead9739 /railties | |
parent | 9864f5e3d693b53c3540637c562a5be6e1e2c66a (diff) | |
download | rails-f069ac2156e3822904c75a140d6012dd867f3521.tar.gz rails-f069ac2156e3822904c75a140d6012dd867f3521.tar.bz2 rails-f069ac2156e3822904c75a140d6012dd867f3521.zip |
Add test that the listen gem is included when RUBY_ENGINE is not 'ruby'
* The fix is already in master since https://github.com/rails/rails/pull/34243
* See https://github.com/rails/rails/pull/35482 for the fix in Rails 5.2
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index d30cd9e718..87de68fdbd 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -678,6 +678,22 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_inclusion_of_listen_related_configuration_on_other_rubies + ruby_engine = Object.send(:remove_const, :RUBY_ENGINE) + Object.const_set(:RUBY_ENGINE, "MyRuby") + begin + run_generator + if RbConfig::CONFIG["host_os"] =~ /darwin|linux/ + assert_listen_related_configuration + else + assert_no_listen_related_configuration + end + ensure + Object.send(:remove_const, :RUBY_ENGINE) + Object.const_set(:RUBY_ENGINE, ruby_engine) + end + end + def test_non_inclusion_of_listen_related_configuration_if_skip_listen run_generator [destination_root, "--skip-listen"] assert_no_listen_related_configuration |