summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/hcl/net.rb14
-rw-r--r--test/ext/capture_output.rb2
-rw-r--r--test/test_helper.rb2
3 files changed, 8 insertions, 10 deletions
diff --git a/lib/hcl/net.rb b/lib/hcl/net.rb
index dc75e39..01fb737 100644
--- a/lib/hcl/net.rb
+++ b/lib/hcl/net.rb
@@ -6,19 +6,17 @@ module HCl
class << self
# configuration accessors
CONFIG_VARS = [ :login, :password, :subdomain, :ssl ].freeze
- CONFIG_VARS.each { |config_var| attr_accessor config_var }
+ CONFIG_VARS.each { |config_var| attr_reader config_var }
def config_hash
CONFIG_VARS.inject({}) {|c,k| c.update(k => send(k)) }
end
- def configure opts = nil
- if opts
- self.login = opts['login']
- self.password = opts['password']
- self.subdomain = opts['subdomain']
- self.ssl = opts['ssl']
- end
+ def configure opts
+ @login = opts['login'].freeze
+ @password = opts['password'].freeze
+ @subdomain = opts['subdomain'].freeze
+ @ssl = !!opts['ssl']
end
def http
diff --git a/test/ext/capture_output.rb b/test/ext/capture_output.rb
index bbf5424..930f408 100644
--- a/test/ext/capture_output.rb
+++ b/test/ext/capture_output.rb
@@ -20,7 +20,7 @@ module CaptureOutput
@stdout.string
end
end
-class MiniTest::Unit::TestCase
+class MiniTest::Test
include CaptureOutput
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 47d3517..f091451 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -27,7 +27,7 @@ require 'fakeweb'
# require test extensions/helpers
Dir[File.dirname(__FILE__) + '/ext/*.rb'].each { |ext| require ext }
-class HCl::TestCase < MiniTest::Unit::TestCase
+class HCl::TestCase < MiniTest::Test
def setup
FakeWeb.allow_net_connect = false
HCl::Net.configure \