Sha256: 9f3f3f629d80f641473cf4481e2e9daaae6f81802bc08392137bb61d8a01e793

Contents?: true

Size: 763 Bytes

Versions: 10

Compression:

Stored size: 763 Bytes

Contents

RSpec.shared_examples :a_chatwork_api do |verb, resource, status = 200|
  context "without block" do
    let(:block) { nil }

    it { should match_example(verb, resource, status) }
  end

  context "with block" do
    let(:block) do
      ->(body, header) do
        @body = body
        @header = header
      end
    end

    it "works with block" do
      subject

      aggregate_failures do
        expect(@body).to match_example(verb, resource, status)

        expect(@header["Content-Type"]).to eq "application/json"
        expect(@header["X-RateLimit-Limit"]).to eq ratelimit_limit
        expect(@header["X-RateLimit-Remaining"]).to eq ratelimit_remaining
        expect(@header["X-RateLimit-Reset"]).to eq ratelimit_reset
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chatwork-1.0.1 spec/support/examples/a_chatwork_api.rb
chatwork-1.0.0 spec/support/examples/a_chatwork_api.rb
chatwork-0.12.3 spec/support/examples/a_chatwork_api.rb
chatwork-0.12.2 spec/support/examples/a_chatwork_api.rb
chatwork-0.12.1 spec/support/examples/a_chatwork_api.rb
chatwork-0.12.0 spec/support/examples/a_chatwork_api.rb
chatwork-0.11.0 spec/support/examples/a_chatwork_api.rb
chatwork-0.10.0 spec/support/examples/a_chatwork_api.rb
chatwork-0.9.0 spec/support/examples/a_chatwork_api.rb
chatwork-0.8.0 spec/support/examples/a_chatwork_api.rb