Sha256: 8a41130f8395825d2b4e13c1ed1e820839d837f69f4ac41279f6cafca793b326

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

describe Pushover do
  describe Pushover::Response do
    let(:excon_response) { Excon::Response.new body: '{}', headers: {} }

    it { is_expected.to have_attributes(status: a_kind_of(String).or(be_nil)) }
    it { is_expected.to have_attributes(request: a_kind_of(String).or(be_nil)) }
    it { is_expected.to have_attributes(errors: a_kind_of(Array).or(be_nil)) }
    it { is_expected.to have_attributes(receipt: a_kind_of(String).or(be_nil)) }
    it { is_expected.to have_attributes(headers: a_kind_of(Hash).or(be_nil)) }
    it { is_expected.to have_attributes(attributes: a_kind_of(Hash).or(be_nil)) }

    it { expect(described_class).to respond_to(:create_from_excon_response).with(1).argument }

    describe "#to_s" do
      it "is expected to be purty." do
        expect(Pushover::Response.create_from_excon_response(excon_response).to_s).to include('status')
      end
    end

    describe "::create_from_excon_response" do
      it { expect(Pushover::Response.create_from_excon_response(excon_response)).to be_a_kind_of described_class }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pushover-3.0.3 spec/pushover/response_spec.rb
pushover-3.0.2 spec/pushover/response_spec.rb
pushover-3.0.1 spec/pushover/response_spec.rb
pushover-3.0.0 spec/pushover/response_spec.rb