spec/support/mock_setup_file.rb in invoker-1.2.0.pre1 vs spec/support/mock_setup_file.rb in invoker-1.2.0.pre2
- old
+ new
@@ -21,20 +21,18 @@
end
private
def setup_invoker_config
- @old_config = Invoker::Power::Config::CONFIG_LOCATION
- Invoker::Power::Config.const_set(:CONFIG_LOCATION, "/tmp/.invoker/config")
+ Invoker::Power::Config.stubs(:config_file).returns("/tmp/.invoker/config")
+ Invoker::Power::Config.stubs(:config_dir).returns("/tmp/.invoker")
safe_make_directory("/tmp/.invoker")
- safe_remove_file(Invoker::Power::Config::CONFIG_LOCATION)
+ safe_remove_file(Invoker::Power::Config.config_file)
end
def restore_invoker_config
- safe_remove_file(Invoker::Power::Config::CONFIG_LOCATION)
- Invoker::Power::Config.const_set(:CONFIG_LOCATION, @old_config)
- $VERBOSE = @original_verbosity
+ safe_remove_file(Invoker::Power::Config.config_file)
end
def restore_osx_resolver_setup
safe_remove_file(Invoker::Power::OsxSetup::RESOLVER_FILE)
FileUtils.rm_rf(Invoker::Power::OsxSetup::RESOLVER_DIR)
@@ -49,20 +47,18 @@
safe_make_directory(Invoker::Power::OsxSetup::RESOLVER_DIR)
safe_remove_file(Invoker::Power::OsxSetup::RESOLVER_FILE)
end
def setup_linux_resolver_path
- @old_linux_resolver = Invoker::Power::LinuxSetup::RESOLVER_FILE
- @old_rinetd_config = Invoker::Power::LinuxSetup::RINETD_FILE
- Invoker::Power::LinuxSetup.const_set(:RESOLVER_FILE, "/tmp/dev-tld")
- Invoker::Power::LinuxSetup.const_set(:RINETD_FILE, "/tmp/rinetd.conf")
- safe_remove_file(Invoker::Power::LinuxSetup::RESOLVER_FILE)
- safe_remove_file(Invoker::Power::LinuxSetup::RINETD_FILE)
+ @old_linux_resolver = Invoker::Power::Distro::Base::RESOLVER_FILE
+ @old_rinetd_config = Invoker::Power::Distro::Base::RINETD_FILE
+ Invoker::Power::Distro::Base.const_set(:RESOLVER_FILE, "/tmp/dev-tld")
+ Invoker::Power::Distro::Base.const_set(:RINETD_FILE, "/tmp/rinetd.conf")
end
def restore_linux_resolver_path
- safe_remove_file(Invoker::Power::LinuxSetup::RESOLVER_FILE)
- safe_remove_file(Invoker::Power::LinuxSetup::RINETD_FILE)
- Invoker::Power::LinuxSetup.const_set(:RESOLVER_FILE, @old_linux_resolver)
- Invoker::Power::LinuxSetup.const_set(:RINETD_FILE, @old_rinetd_config)
+ safe_remove_file(Invoker::Power::Distro::Base::RESOLVER_FILE)
+ safe_remove_file(Invoker::Power::Distro::Base::RINETD_FILE)
+ Invoker::Power::Distro::Base.const_set(:RESOLVER_FILE, @old_linux_resolver)
+ Invoker::Power::Distro::Base.const_set(:RINETD_FILE, @old_rinetd_config)
end
end