Skip to content

Commit e85dca1

Browse files
committed
Fix Config stub to not conflict with spec_helper
Only define the minimal Config stub if it's not already defined, to avoid overriding the real Config class when spec_helper is also loaded.
1 parent e101b03 commit e85dca1

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

spec/lightweight_spec_helper.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
module VCAP
99
module CloudController
1010
# Minimal Config stub for message validation specs
11-
class Config
12-
def self.config
13-
@config ||= new
14-
end
11+
# Only define if not already defined (avoid conflict with spec_helper)
12+
unless defined?(Config)
13+
class Config
14+
def self.config
15+
@config ||= new
16+
end
1517

16-
def get(*_keys)
17-
nil
18+
def get(*_keys)
19+
nil
20+
end
1821
end
1922
end
2023
end

0 commit comments

Comments
 (0)