diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-12-05 23:02:21 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-12-05 23:02:21 -0800 |
commit | 4e9b4f97bea29893eeb65f1fab4f2cc676091994 (patch) | |
tree | a6d5e7858645250e72f1650a2a966c4967af41e7 | |
parent | 8b689761823d8f59fe992c9ba9fd771eebdaa3f2 (diff) | |
download | chef-4e9b4f97bea29893eeb65f1fab4f2cc676091994.tar.gz |
class variables instead of class instance variables?
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | spec/functional/resource/apt_package_spec.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/functional/resource/apt_package_spec.rb b/spec/functional/resource/apt_package_spec.rb index dd9afaff13..6ec3dfea0f 100644 --- a/spec/functional/resource/apt_package_spec.rb +++ b/spec/functional/resource/apt_package_spec.rb @@ -22,7 +22,13 @@ require "webrick" module AptServer class << self - attr_accessor :alreadyfailed + def alreadyfailed=(val) + @@alreadyfailed = val + end + + def alreadyfailed? + !@@alreadyfailed + end end def enable_testing_apt_source @@ -67,7 +73,7 @@ module AptServer end def start_apt_server - if AptServer.alreadyfailed + if AptServer.alreadyfailed? raise "aborting the rest of the apt-package func tests due to failure in the before block" end @apt_server_thread = Thread.new do @@ -88,7 +94,7 @@ module AptServer # swallow the errors the second time (which unfortunately creates cascading errors which # have nothing to do with the problem), but the first time we throw the exception so # that debugging can hopefully proceeed. - if !AptServer.alreadyfailed + if !AptServer.alreadyfailed? AptServer.alreadyfailed = true raise end |