Sha256: 5712b3c77375077e4dbe48c71a2784af52b04b629da545d569afdb6644525a41

Contents?: true

Size: 902 Bytes

Versions: 5

Compression:

Stored size: 902 Bytes

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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
loquor-0.5.3 test/client_test.rb
loquor-0.5.2 test/client_test.rb
loquor-0.5.1 test/client_test.rb
loquor-0.5.0 test/client_test.rb
loquor-0.4.0 test/client_test.rb