diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-11-29 14:53:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 14:53:19 -0500 |
commit | c8e4d5a1e3be2290bc6007987e40312e19480474 (patch) | |
tree | b9cb04098bb4af58e3b4c2d97bb2872d3a1e2235 /activesupport/test | |
parent | 5bb4546439ed20a864c6df18788dce0eb45d8326 (diff) | |
parent | 8212dfcf14c63c006b9e1c37595f3d62eab052cf (diff) | |
download | rails-c8e4d5a1e3be2290bc6007987e40312e19480474.tar.gz rails-c8e4d5a1e3be2290bc6007987e40312e19480474.tar.bz2 rails-c8e4d5a1e3be2290bc6007987e40312e19480474.zip |
Merge pull request #34553 from mjtko/fix/issue-14802
Do nothing when the same block is included again
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/concern_test.rb | 8 | ||||
-rw-r--r-- | activesupport/test/fixtures/concern/some_concern.rb | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/activesupport/test/concern_test.rb b/activesupport/test/concern_test.rb index 98d8f3ee0d..4b3cfcd1d2 100644 --- a/activesupport/test/concern_test.rb +++ b/activesupport/test/concern_test.rb @@ -128,4 +128,12 @@ class ConcernTest < ActiveSupport::TestCase end end end + + def test_no_raise_on_same_included_call + assert_nothing_raised do + 2.times do + load File.expand_path("../fixtures/concern/some_concern.rb", __FILE__) + end + end + end end diff --git a/activesupport/test/fixtures/concern/some_concern.rb b/activesupport/test/fixtures/concern/some_concern.rb new file mode 100644 index 0000000000..87f660a81e --- /dev/null +++ b/activesupport/test/fixtures/concern/some_concern.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require "active_support/concern" + +module SomeConcern + extend ActiveSupport::Concern + + included do + # shouldn't raise when module is loaded more than once + end +end |