Sha256: d0b12a9157eefeadad25accd0566b37e39ce8334c4d09aa8a47ca60565d24858

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

class Client < Rapidash::Client
  method :test
end

describe Rapidash::Client do

  let!(:subject) { Client.new }

  it "should raise an error when instantiated" do
    expect {
     Rapidash::Client.new
    }.to raise_error(Rapidash::ConfigurationError)
  end

  describe ".get" do
    it "should call request" do
      subject.should_receive(:request).with(:get, "foo", {})
      subject.get("foo")
    end
  end

  describe ".post" do
    it "should call request" do
      subject.should_receive(:request).with(:post, "foo", {})
      subject.post("foo")
    end
  end

  describe ".put" do
    it "should call request" do
      subject.should_receive(:request).with(:put, "foo", {})
      subject.put("foo")
    end
  end

  describe ".patch" do
    it "should call request" do
      subject.should_receive(:request).with(:patch, "foo", {})
      subject.patch("foo")
    end
  end

  describe ".delete" do
    it "should call request" do
      subject.should_receive(:request).with(:delete, "foo", {})
      subject.delete("foo")
    end
  end



end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rapidash-0.1.2 spec/rapidash/client_spec.rb
rapidash-0.1.1 spec/rapidash/client_spec.rb
rapidash-0.1.0 spec/rapidash/client_spec.rb
rapidash-0.0.6 spec/rapidash/client_spec.rb
rapidash-0.0.5 spec/rapidash/client_spec.rb
rapidash-0.0.4 spec/rapidash/client_spec.rb