Sha256: 70a47c4bb4c48d0915ca567bef53de0da0fadcdca6a6464d1ab67d6f0aeab15e

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

Feature: Getting integers from the document
  In order to provide simpler way of getting integers from a node
  As a traverser
  I want to access nodes using the int method and an xpath
  
  Scenario: getting the int of a single node
    When I parse the XML:
      """
        <root>
          <name>St. George's Arms</name>
          <average_price>20.32</average_price>
          <number_of_beers>2</number_of_beers>
        </root>
      """
    And I call "int('/root/number_of_beers')" on the document
    Then the result should be 2
    
  Scenario: getting the int of a single node with whitespace
    When I parse the XML:
      """
        <root>
          <name>St. George's Arms</name>
          <average_price>20.32</average_price>
          <number_of_beers>
            2
          </number_of_beers>
        </root>
      """
    And I call "int('/root/number_of_beers')" on the document
    Then the result should be 2
    
  Scenario: getting the int of a non-existent node
    When I parse the XML:
      """
        <root>
          <name>St. George's Arms</name>
          <average_price>20.32</average_price>
          <number_of_beers>2</number_of_beers>
        </root>
      """
    Then calling "int('//something/missing')" on the document should raise a "NotFound" error
    And the error should have the xpath "//something/missing"
    And the error should have a stored node

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dozuki-0.0.1 features/int_accessor.feature