Sha256: 4452023d77630c30e02c9cc4319e3e4c192b38c76bc8dab6f8338a3321be282f

Contents?: true

Size: 579 Bytes

Versions: 3

Compression:

Stored size: 579 Bytes

Contents

require "test_helper"

class TestTokenable < MiniTest::Test
  def test_parses_next_token
    xml = <<-EOF
    <NextToken xmlns="example">123</NextToken>
    EOF
    tokenable = build_tokenable(xml)

    assert_equal "123", tokenable.next_token
  end

  def test_returns_nil_if_next_token_is_not_present
    xml = <<-EOF
    <Foo xmlns="example"/>
    EOF
    tokenable = build_tokenable(xml)

    refute tokenable.next_token
  end

  private

  def build_tokenable(xml)
    klass = Class.new(Collection) do
      include Tokenable
    end

    klass.new(Nokogiri(xml))
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mws-orders-0.2.1 test/mws/orders/test_tokenable.rb
mws-orders-0.2.0 test/mws/orders/test_tokenable.rb
mws-orders-0.1.1 test/mws/orders/test_tokenable.rb