Sha256: 235f33e6ca2d17c6e927d6571fc67094324c73bfcf72237f3777dfb64810a9aa

Contents?: true

Size: 804 Bytes

Versions: 3

Compression:

Stored size: 804 Bytes

Contents

require "spec_helper"

describe CandyCheck::PlayStore::VerificationFailure do
  subject { CandyCheck::PlayStore::VerificationFailure.new(fake_error) }

  describe "denied" do
    let(:fake_error) do
      FakeError.new("401", "The current user has insufficient permissions")
    end

    it "returns the code" do
      subject.code.must_equal 401
    end

    it "returns the message" do
      subject.message.must_equal "The current user has insufficient permissions"
    end
  end

  describe "empty" do
    let(:fake_error) do
      FakeError.new(nil, nil)
    end

    it "returns an unknown code" do
      subject.code.must_equal(-1)
    end

    it "returns an unknown message" do
      subject.message.must_equal "Unknown error"
    end
  end

  FakeError = Struct.new(:status_code, :message)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
candy_check-0.3.0 spec/play_store/verification_failure_spec.rb
candy_check-0.2.1 spec/play_store/verification_failure_spec.rb
candy_check-0.2.0 spec/play_store/verification_failure_spec.rb