Skip to content
Permalink
Browse files

Address MRI 2.2 warnings (possible reference to past scope).

From ruby/ruby@f5f6218.
It causes 280 warnings in our spec suite :(. The fix is to change the names of
variables and/or `let` definitions so they do not clash.

/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:92: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:93: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:94: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:177: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:191: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:192: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:196: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:197: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:201: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:203: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:208: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:218: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:258: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:259: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_call_original_spec.rb:260: warning: possible reference to past scope - instance
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_yield_spec.rb:142: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/and_yield_spec.rb:148: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:718: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:719: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:723: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:729: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:740: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:741: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:747: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:760: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:761: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:766: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:773: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:774: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:781: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:782: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:791: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:792: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:798: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:799: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:808: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:809: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:815: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:816: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:824: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:825: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:834: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:835: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:841: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:842: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:850: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:851: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:860: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:861: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:867: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:868: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:875: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:876: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:883: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:884: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:889: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:890: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:896: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:897: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:906: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:912: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:913: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:919: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:920: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:921: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:926: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:927: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:941: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:947: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:948: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:954: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:955: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:959: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:963: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:964: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:968: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:969: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:973: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:974: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:980: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:986: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:990: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:994: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1002: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1003: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1009: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1013: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1017: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1024: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1025: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1029: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1035: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1039: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1050: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1051: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1055: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1062: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1063: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1066: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1067: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1072: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1073: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1088: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1091: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1110: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1111: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1116: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1119: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1134: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1137: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1143: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1144: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1181: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1184: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1192: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1215: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1217: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1226: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/any_instance_spec.rb:1228: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/combining_implementation_instructions_spec.rb:129: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/combining_implementation_instructions_spec.rb:134: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/combining_implementation_instructions_spec.rb:139: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/combining_implementation_instructions_spec.rb:144: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/combining_implementation_instructions_spec.rb:150: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/combining_implementation_instructions_spec.rb:156: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/double_spec.rb:72: warning: possible reference to past scope - double
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:144: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:145: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:146: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:151: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:156: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:159: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:162: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:163: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:164: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:170: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:177: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:181: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:186: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:193: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:197: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:202: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:301: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:302: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:304: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:305: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:309: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:310: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:311: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:313: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:314: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:315: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:319: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:320: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:321: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:323: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:324: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:325: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:329: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:330: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:331: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:333: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:334: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:338: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:339: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:340: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:343: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:344: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:349: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:350: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:351: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:354: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:355: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:360: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:361: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:362: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:365: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:366: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:371: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:372: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:375: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:376: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:382: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:383: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:387: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:388: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:393: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:394: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:401: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:402: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:404: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:405: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:409: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:410: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:415: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/matchers/have_received_spec.rb:416: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:197: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:205: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:208: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:211: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:218: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:222: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:245: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:296: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:332: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:337: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:343: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/partial_double_spec.rb:352: warning: possible reference to past scope - klass
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:136: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:136: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:137: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:137: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:138: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:138: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:142: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:143: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:149: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:150: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:161: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:162: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:166: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:167: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:171: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:201: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:201: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:202: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:202: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:203: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:203: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:207: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:208: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:214: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/space_spec.rb:215: warning: possible reference to past scope - space
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/stubbed_message_expectations_spec.rb:46: warning: possible reference to past scope - double
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/to_ary_spec.rb:24: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/to_ary_spec.rb:28: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/to_ary_spec.rb:32: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/to_ary_spec.rb:41: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/to_ary_spec.rb:45: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/to_ary_spec.rb:49: warning: possible reference to past scope - obj
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:25: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:31: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:39: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:47: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:51: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:62: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:68: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:74: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:82: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:99: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:107: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:113: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb:121: warning: possible reference to past scope - dbl
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:160: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:160: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:161: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:162: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:163: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:168: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:174: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:179: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:180: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:181: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:183: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:184: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:185: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:189: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:190: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:191: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:196: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:197: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:198: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:202: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:203: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_loaded_spec.rb:204: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_not_loaded_spec.rb:46: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_not_loaded_spec.rb:46: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_not_loaded_spec.rb:50: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_not_loaded_spec.rb:51: warning: possible reference to past scope - o
/Users/myron/code/rspec-dev/repos/rspec-mocks/spec/rspec/mocks/verifying_doubles/instance_double_with_class_not_loaded_spec.rb:52: warning: possible reference to past scope - o
  • Loading branch information...
myronmarston committed Dec 27, 2014
1 parent 163d600 commit 3b909ed1a951bbca340ea98c27ab65da7f43881c
@@ -81,10 +81,10 @@ def instance.foo; :bar; end
end

it 'works for SimpleDelegator subclasses', :if => (RUBY_VERSION.to_f > 1.8) do
instance = Class.new(SimpleDelegator).new(1)
def instance.foo; :bar; end
expect(instance).to receive(:foo).and_call_original
expect(instance.foo).to eq(:bar)
inst = Class.new(SimpleDelegator).new(1)
def inst.foo; :bar; end
expect(inst).to receive(:foo).and_call_original
expect(inst.foo).to eq(:bar)
end
end

@@ -162,14 +162,14 @@ def instance.foo; :bar; end
end

it 'works for aliased methods' do
klass = Class.new do
klazz = Class.new do
class << self
alias alternate_new new
end
end

expect(klass).to receive(:alternate_new).and_call_original
expect(klass.alternate_new).to be_an_instance_of(klass)
expect(klazz).to receive(:alternate_new).and_call_original
expect(klazz.alternate_new).to be_an_instance_of(klazz)
end

context 'on an object that defines method_missing' do
@@ -90,8 +90,8 @@
expect(yielded_arg).to receive(:bar)
end

obj.method_that_accepts_a_block do |obj|
obj.bar
obj.method_that_accepts_a_block do |object|
object.bar
foo
end

@@ -103,25 +103,25 @@
it "yields the default argument when the argument is not given" do
pending "Not sure how to achieve this yet. See rspec/rspec-mocks#714 and rspec/rspec-support#85."
default_arg = Object.new
obj = Object.new
object = Object.new

allow(obj).to receive(:a_message).and_yield
allow(object).to receive(:a_message).and_yield
expect(default_arg).to receive(:bar)

eval("obj.a_message { |receiver=default_arg| receiver.bar }")
eval("object.a_message { |receiver=default_arg| receiver.bar }")
end

it "yields given argument when the argument is given" do
default_arg = Object.new
allow(default_arg).to receive(:bar)

given_arg = Object.new
obj = Object.new
object = Object.new

allow(obj).to receive(:a_message).and_yield(given_arg)
allow(object).to receive(:a_message).and_yield(given_arg)
expect(given_arg).to receive(:bar)

eval("obj.a_message { |receiver=default_arg| receiver.bar }")
eval("object.a_message { |receiver=default_arg| receiver.bar }")
end
end

@@ -695,22 +695,22 @@ def inspect
end

it 'works with a BasicObject subclass that mixes in Kernel', :if => defined?(BasicObject) do
klass = Class.new(BasicObject) do
klazz = Class.new(BasicObject) do
include ::Kernel
def foo; end
end

expect_any_instance_of(klass).to receive(:foo)
klass.new.foo
expect_any_instance_of(klazz).to receive(:foo)
klazz.new.foo
end

it 'works with a SimpleDelegator subclass', :if => (RUBY_VERSION.to_f > 1.8) do
klass = Class.new(SimpleDelegator) do
klazz = Class.new(SimpleDelegator) do
def foo; end
end

expect_any_instance_of(klass).to receive(:foo)
klass.new(Object.new).foo
expect_any_instance_of(klazz).to receive(:foo)
klazz.new(Object.new).foo
end

context "with argument matching" do
@@ -1094,13 +1094,13 @@ def foo; end
end

it "does not pass the instance to and_call_original" do
klass = Class.new do
klazz = Class.new do
def call(*args)
args.first
end
end
expect_any_instance_of(klass).to receive(:call).and_call_original
instance = klass.new
expect_any_instance_of(klazz).to receive(:call).and_call_original
instance = klazz.new
expect(instance.call(:bees)).to be :bees
end
end
@@ -1159,21 +1159,21 @@ def call(*args)
end

it "doesn't bomb if the object doesn't support `dup`" do
klass = Class.new do
klazz = Class.new do
undef_method :dup
end
allow_any_instance_of(klass).to receive(:foo)
allow_any_instance_of(klazz).to receive(:foo)
end

it "doesn't fail when dup accepts parameters" do
klass = Class.new do
klazz = Class.new do
def dup(funky_option)
end
end

allow_any_instance_of(klass).to receive(:foo)
allow_any_instance_of(klazz).to receive(:foo)

expect { klass.new.dup('Dup dup dup') }.to_not raise_error
expect { klazz.new.dup('Dup dup dup') }.to_not raise_error
end
end

@@ -125,35 +125,35 @@ def verify_combined_implementation
end

describe "a double that already has a terminal `and_return(x)` action" do
let(:dbl) { double }
let(:stubbed_double) { allow(dbl).to receive(:foo) }
let(:the_dbl) { double }
let(:stubbed_double) { allow(the_dbl).to receive(:foo) }
before { stubbed_double.and_return(1) }

it 'allows the terminal action to be overriden to `and_return(y)`' do
stubbed_double.and_return(3)
expect(dbl.foo).to eq(3)
expect(the_dbl.foo).to eq(3)
end

it 'allows the terminal action to be overriden to `and_raise(y)`' do
stubbed_double.and_raise("boom")
expect { dbl.foo }.to raise_error("boom")
expect { the_dbl.foo }.to raise_error("boom")
end

it 'allows the terminal action to be overriden to `and_throw(y)`' do
stubbed_double.and_throw(:bar)
expect { dbl.foo }.to throw_symbol(:bar)
expect { the_dbl.foo }.to throw_symbol(:bar)
end
end

describe "a double that already has a terminal block action" do
let(:dbl) { double }
let(:stubbed_double) { allow(dbl).to receive(:foo) }
let(:the_dbl) { double }
let(:stubbed_double) { allow(the_dbl).to receive(:foo) }

it "allows the block action to be overridden" do
allow(RSpec).to receive(:warning)
stubbed_double.with(:arg) { :with_block }
stubbed_double.at_least(:once) { :at_least_block }
expect(dbl.foo(:arg)).to eq(:at_least_block)
expect(the_dbl.foo(:arg)).to eq(:at_least_block)
end
end

@@ -13,8 +13,8 @@ module Mocks
end

it "uses 'Double' in failure messages" do
double = double('name')
expect { double.foo }.to raise_error(/Double "name" received/)
dbl = double('name')
expect { dbl.foo }.to raise_error(/Double "name" received/)
end

it "hides internals in its inspect representation" do

0 comments on commit 3b909ed

Please sign in to comment.
You can’t perform that action at this time.