Sha256: ef7cc1ee9d34c52408364f14f512fe4df2885d08b76f96ff3906e5c8f120d489

Contents?: true

Size: 1.12 KB

Versions: 12

Compression:

Stored size: 1.12 KB

Contents

require File.expand_path('../test_helper', __FILE__)

module Loquor
  class ClientTest < Minitest::Test
    def test_initialize_should_create_config
      Configuration.expects(:new)
      Client.new
    end

    def test_get_calls_gets
      url = "foobar"

      client = Client.new
      deps = {config: client.config}
      HttpAction::Get.expects(:get).with(url, deps)
      client.get(url)
    end

    def test_put_calls_puts
      url = "foobar"
      payload = {foo: 'bar'}

      client = Client.new
      deps = {config: client.config}
      HttpAction::Put.expects(:put).with(url, payload, deps)
      client.put(url, payload)
    end

    def test_post_calls_posts
      url = "foobar"
      payload = {x: true}

      client = Client.new
      deps = {config: client.config}
      HttpAction::Post.expects(:post).with(url, payload, deps)
      client.post(url, payload)
    end
    

    def test_get_calls_gets_with_cache_flag
      url = "foobar"

      client = Client.new
      deps = {config: client.config, should_cache: true}
      HttpAction::Get.expects(:get).with(url, deps)
      client.get(url, cache=true)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
loquor-1.4.0 test/client_test.rb
loquor-1.3.0 test/client_test.rb
loquor-1.2.1 test/client_test.rb
loquor-1.2.0 test/client_test.rb
loquor-1.1.1 test/client_test.rb
loquor-1.1.0 test/client_test.rb
loquor-1.0.0 test/client_test.rb
loquor-0.9.0 test/client_test.rb
loquor-0.8.0 test/client_test.rb
loquor-0.7.0 test/client_test.rb
loquor-0.6.0 test/client_test.rb
loquor-0.5.4 test/client_test.rb