Sha256: 168dbcb07c64a433277f699ebb610d3ab9ada4005ddd74a80902cc0ad460d133

Contents?: true

Size: 817 Bytes

Versions: 2

Compression:

Stored size: 817 Bytes

Contents

require 'parser_helper'
require 'mws/sellers/parsers/service_status'

class SellersServiceStatusParserTest < ParserTest
  def setup
    node = fixture('sellers/service_status').xpath('//xmlns:GetServiceStatusResult').first
    @service_status = MWS::Sellers::Parsers::ServiceStatus.new(node)
  end

  def test_status
    assert_kind_of String, @service_status.status
  end

  def test_timestamp
    assert_kind_of Time, @service_status.timestamp
  end

  def test_messages
    assert_kind_of Array, @service_status.messages
  end

  def test_ok?
    @service_status.stub(:status, 'GREEN') do
      assert @service_status.ok?
    end

    @service_status.stub(:status, 'RED') do
      refute @service_status.ok?
    end
  end

  def test_inspect
    assert_equal @service_status.status, @service_status.to_s
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peddler-0.6.5 test/mws/sellers/parsers/test_service_status.rb
peddler-0.6.4 test/mws/sellers/parsers/test_service_status.rb