test/test_tracksale.rb in tracksale-0.0.3 vs test/test_tracksale.rb in tracksale-0.0.4
- old
+ new
@@ -1,12 +1,19 @@
require 'minitest/autorun'
require 'tracksale'
class TracksaleTest < Minitest::Test
- def test_configure
+ def test_configure_key
Tracksale.configure do |config|
config.key = 'foobar'
end
assert_equal 'foobar', Tracksale::Client.new.key
+ end
+
+ def test_configure_client
+ Tracksale.configure {|c| c.force_dummy_client(false) } #default
+ assert_equal Tracksale::Client, Tracksale.configuration.client
+ Tracksale.configure {|c| c.force_dummy_client }
+ assert_equal Tracksale::DummyClient, Tracksale.configuration.client
end
end