Sha256: ef5087a9df4d46ac28b3ef189b085f9a13b23076ce8c174491872ef993250eab

Contents?: true

Size: 833 Bytes

Versions: 7

Compression:

Stored size: 833 Bytes

Contents

require 'helper'

class TestConfiguration < Test::Unit::TestCase
  def reset_defaults
    Whatser::Client.configure do |config|
      config.api_key = nil
      config.api_secret = nil
      config.oauth_token = nil
      config.logger = nil
    end
  end
  
  def test_valid_options_keys
    expected = [:api_key,:api_secret,:username,:password,:oauth_token,:api_uri,:redirect_uri,:logger]
    assert_equal expected, Whatser::Configuration::VALID_OPTIONS_KEYS
  end
  
  def test_defaults_on_inclusion
    reset_defaults
    client = Whatser::Client.new
    assert_equal nil, client.api_key
    assert_equal nil, client.api_secret
    assert_equal nil, client.oauth_token
    assert_equal nil, client.redirect_uri
    assert_equal nil, client.logger
    assert_equal Whatser::Configuration::DEFAULT_API_URI, client.api_uri
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
whatser-0.6.1 test/test_configuration.rb
whatser-0.6.0 test/test_configuration.rb
whatser-0.5.0 test/test_configuration.rb
whatser-0.4.0 test/test_configuration.rb
whatser-0.3.2 test/test_configuration.rb
whatser-0.3.1 test/test_configuration.rb
whatser-0.3.0 test/test_configuration.rb