Sha256: eac91355ff230d1e682237b5b05ad670a8e7f13a8ce00b261ff0f215d9c33dd0

Contents?: true

Size: 761 Bytes

Versions: 4

Compression:

Stored size: 761 Bytes

Contents

require 'spec_helper'

describe Pushover::Receipt do
  it { is_expected.to have_attributes(receipt: a_kind_of(String).or(be_nil)) }
  it { is_expected.to have_attributes(token: a_kind_of(String).or(be_nil)) }

  it { is_expected.to respond_to(:get).with(0).argument }

  describe "#push" do
    let(:params) { { 'token' => 't', 'receipt' => 'receipt' } }

    it "is expected to send" do
      expect { described_class.new(params).get }.to raise_error Excon::Error::StubNotFound
    end

    ['token', 'receipt'].each do |param|
      context "when #{param} is not supplied" do
        before { params.delete param }

        it { expect { described_class.new(params).get }.to raise_error RuntimeError, /#{param} must be supplied/ }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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