Namespace
Methods
S
T
Instance Public methods
setup()
# File activesupport/test/concern_test.rb, line 62
def setup
  @klass = Class.new
end
test()
# File activesupport/test/concern_test.rb, line 87
def test
end
test_class_methods_are_extended()
# File activesupport/test/concern_test.rb, line 72
def test_class_methods_are_extended
  @klass.send(:include, Baz)
  assert_equal "baz", @klass.baz
  assert_equal ConcernTest::Baz::ClassMethods, (class << @klass; self.included_modules; end)[0]
end
test_class_methods_are_extended_only_on_expected_objects()
# File activesupport/test/concern_test.rb, line 78
def test_class_methods_are_extended_only_on_expected_objects
  ::Object.__send__(:include, Qux)
  Object.extend(Qux::ClassMethods)
  # module needs to be created after Qux is included in Object or bug won't
  # be triggered
  test_module = Module.new do
    extend ActiveSupport::Concern

    class_methods do
      def test
      end
    end
  end
  @klass.send(:include, test_module)
  assert_equal false, Object.respond_to?(:test)
  Qux.class_eval do
    remove_const :ClassMethods
  end
end
test_dependencies_with_multiple_modules()
# File activesupport/test/concern_test.rb, line 111
def test_dependencies_with_multiple_modules
  @klass.send(:include, Foo)
  assert_equal [ConcernTest::Foo, ConcernTest::Bar, ConcernTest::Baz], @klass.included_modules[0..2]
end
test_included_block_is_ran()
# File activesupport/test/concern_test.rb, line 98
def test_included_block_is_ran
  @klass.send(:include, Baz)
  assert_equal true, @klass.included_ran
end
test_module_is_included_normally()
# File activesupport/test/concern_test.rb, line 66
def test_module_is_included_normally
  @klass.send(:include, Baz)
  assert_equal "baz", @klass.new.baz
  assert @klass.included_modules.include?(ConcernTest::Baz)
end
test_modules_dependencies_are_met()
# File activesupport/test/concern_test.rb, line 103
def test_modules_dependencies_are_met
  @klass.send(:include, Bar)
  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)
end
test_raise_on_multiple_included_calls()
# File activesupport/test/concern_test.rb, line 116
def test_raise_on_multiple_included_calls
  assert_raises(ActiveSupport::Concern::MultipleIncludedBlocks) do
    Module.new do
      extend ActiveSupport::Concern

      included do
      end

      included do
      end
    end
  end
end