diff options
Diffstat (limited to 'activesupport/test/concern_test.rb')
-rw-r--r-- | activesupport/test/concern_test.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/activesupport/test/concern_test.rb b/activesupport/test/concern_test.rb index 8ea701cfb7..ef75a320d1 100644 --- a/activesupport/test/concern_test.rb +++ b/activesupport/test/concern_test.rb @@ -1,5 +1,7 @@ -require 'abstract_unit' -require 'active_support/concern' +# frozen_string_literal: true + +require "abstract_unit" +require "active_support/concern" class ConcernTest < ActiveSupport::TestCase module Baz @@ -66,17 +68,17 @@ class ConcernTest < ActiveSupport::TestCase def test_module_is_included_normally @klass.include(Baz) assert_equal "baz", @klass.new.baz - assert @klass.included_modules.include?(ConcernTest::Baz) + assert_includes @klass.included_modules, ConcernTest::Baz end def test_class_methods_are_extended @klass.include(Baz) assert_equal "baz", @klass.baz - assert_equal ConcernTest::Baz::ClassMethods, (class << @klass; self.included_modules; end)[0] + assert_equal ConcernTest::Baz::ClassMethods, (class << @klass; included_modules; end)[0] end def test_class_methods_are_extended_only_on_expected_objects - ::Object.__send__(:include, Qux) + ::Object.include(Qux) Object.extend(Qux::ClassMethods) # module needs to be created after Qux is included in Object or bug won't # be triggered @@ -105,7 +107,7 @@ class ConcernTest < ActiveSupport::TestCase assert_equal "bar", @klass.new.bar assert_equal "bar+baz", @klass.new.baz assert_equal "bar's baz + baz", @klass.baz - assert @klass.included_modules.include?(ConcernTest::Bar) + assert_includes @klass.included_modules, ConcernTest::Bar end def test_dependencies_with_multiple_modules |