diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-11-13 13:17:24 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-11-13 13:17:24 +0100 |
commit | 6d05967468ea58ba481259718f07b3cb5a386945 (patch) | |
tree | e21976cdae28f91bcac002dc463a099ca64d111d /spec/ruby/fixtures/constants.rb | |
parent | acbe7aa19705905e7ad1952395e98e8bfe583a97 (diff) | |
download | ruby-6d05967468ea58ba481259718f07b3cb5a386945.tar.gz |
Update to ruby/spec@b0b7f53
Diffstat (limited to 'spec/ruby/fixtures/constants.rb')
-rw-r--r-- | spec/ruby/fixtures/constants.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/ruby/fixtures/constants.rb b/spec/ruby/fixtures/constants.rb index e5b20596ef..37271ddcc8 100644 --- a/spec/ruby/fixtures/constants.rb +++ b/spec/ruby/fixtures/constants.rb @@ -1,7 +1,7 @@ # Contains all static code examples of all constants behavior in language and # library specs. The specs include language/constants_spec.rb and the specs -# for Module#const_defined?, Module#const_get, Module#const_set, -# Module#remove_const, Module#const_missing and Module#constants. +# for Module#const_defined?, Module#const_get, Module#const_set, Module#remove_const, +# Module#const_source_location, Module#const_missing and Module#constants. # # Rather than defining a class structure for each example, a canonical set of # classes is used along with numerous constants, in most cases, a unique @@ -28,14 +28,17 @@ # for completeness. No other constant of this name should be defined in the # specs. CS_CONST1 = :const1 # only defined here +CS_CONST1_LINE = __LINE__ - 1 module ConstantSpecs # Included at toplevel module ModuleA CS_CONST10 = :const10_1 + CS_CONST10_LINE = __LINE__ - 1 CS_CONST12 = :const12_2 CS_CONST13 = :const13 + CS_CONST13_LINE = __LINE__ - 1 CS_CONST21 = :const21_2 end @@ -44,12 +47,14 @@ module ConstantSpecs CS_CONST10 = :const10_9 CS_CONST11 = :const11_2 CS_CONST12 = :const12_1 + CS_CONST12_LINE = __LINE__ - 1 end # Included in ChildA module ModuleC CS_CONST10 = :const10_4 CS_CONST15 = :const15_1 + CS_CONST15_LINE = __LINE__ - 1 end # Included in ChildA metaclass @@ -75,7 +80,9 @@ module ConstantSpecs # are run. class ClassA + CS_CLASS_A_LINE = __LINE__ - 1 CS_CONST10 = :const10_10 + CS_CONST10_LINE = __LINE__ - 1 CS_CONST16 = :const16 CS_CONST17 = :const17_2 CS_CONST22 = :const22_1 @@ -97,10 +104,14 @@ module ConstantSpecs include ModuleB CS_CONST4 = :const4 + CS_CONST4_LINE = __LINE__ - 1 CS_CONST10 = :const10_5 + CS_CONST10_LINE = __LINE__ - 1 CS_CONST11 = :const11_1 + CS_CONST11_LINE = __LINE__ - 1 CS_CONST15 = :const15_2 CS_CONST20 = :const20_2 + CS_CONST20_LINE = __LINE__ - 1 CS_CONST21 = :const21_1 CS_CONST22 = :const22_2 @@ -118,6 +129,7 @@ module ConstantSpecs CS_CONST5 = :const5 CS_CONST10 = :const10_2 + CS_CONST10_LINE = __LINE__ - 1 CS_CONST23 = :const23 class ChildA < ParentA @@ -135,6 +147,7 @@ module ConstantSpecs CS_CONST6 = :const6 CS_CONST10 = :const10_3 + CS_CONST10_LINE = __LINE__ - 1 CS_CONST19 = :const19_2 def self.const10; CS_CONST10; end @@ -282,6 +295,7 @@ module ConstantSpecs end CS_PRIVATE = :cs_private + CS_PRIVATE_LINE = __LINE__ - 1 private_constant :CS_PRIVATE end |