test/units/geo_certs_test.rb in geocerts-0.0.23 vs test/units/geo_certs_test.rb in geocerts-0.0.24

- old
+ new

@@ -3,16 +3,28 @@ class GeoCertsTest < Test::Unit::TestCase context 'GeoCerts' do should 'use the sandbox host' do - GeoCerts.sandbox = true - assert_equal('sandbox.geocerts.com', GeoCerts.host) + setting(GeoCerts, :sandbox, :to => true) do + assert_equal('sandbox.geocerts.com', GeoCerts.host) + end end should 'use the production host' do - GeoCerts.sandbox = false - assert_equal('www.geocerts.com', GeoCerts.host) + setting(GeoCerts, :sandbox, :to => false) do + assert_equal('www.geocerts.com', GeoCerts.host) + end + end + + should 'use the given host' do + setting(GeoCerts, :host, :to => 'test.com', :back => nil) do + assert_equal('test.com', GeoCerts.host) + end + + setting(GeoCerts, :host, :to => 'test.com:8000', :back => nil) do + assert_equal('test.com:8000', GeoCerts.host) + end end end end