Sha256: 22d7be39526385f0886e2784469d79434960218085e4b560ed2d9b3899ad4b20

Contents?: true

Size: 1.39 KB

Versions: 15

Compression:

Stored size: 1.39 KB

Contents

Feature: Printing hash

  Scenario: A simple array of hashes
    Given a variable named data with
      |title        | author |
      |First post!  | Ryan   |  
      |Second post! | John   |  
      |Third post!  | Peter  |
    When I table_print data
    Then the output should contain
    """
    TITLE        | AUTHOR
    -------------|-------
    First post!  | Ryan  
    Second post! | John  
    Third post!  | Peter
    """

  Scenario: A lambda column
    Given a variable named data with
      |title        | author |
      |First post!  | Ryan   |  
      |Second post! | John   |  
      |Third post!  | Peter  |
    When I table_print data, [:include => {:two => lambda{|hash| hash[:author]*2}}]
    Then the output should contain
    """
    TITLE        | AUTHOR | TWO       
    -------------|--------|-----------
    First post!  | Ryan   | RyanRyan  
    Second post! | John   | JohnJohn  
    Third post!  | Peter  | PeterPeter
    """

  Scenario: A method on the object
    Given a variable named data with
      |title        | author |
      |First post!  | Ryan   |  
      |Second post! | John   |  
      |Third post!  | Peter  |
    When I table_print data, [:include => :size]
    Then the output should contain
    """
    TITLE        | AUTHOR | SIZE
    -------------|--------|-----
    First post!  | Ryan   | 2   
    Second post! | John   | 2   
    Third post!  | Peter  | 2   
    """


Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
table_print-1.5.7 features/printing_hash.feature
table_print-1.5.6 features/printing_hash.feature
table_print-1.5.5 features/printing_hash.feature
table_print-1.5.4 features/printing_hash.feature
table_print-1.5.3 features/printing_hash.feature
table_print-1.5.2 features/printing_hash.feature
table_print-1.5.1 features/printing_hash.feature
table_print-1.5.0 features/printing_hash.feature
table_print-1.4.1 features/printing_hash.feature
table_print-1.4.0 features/printing_hash.feature
table_print-1.3.3 features/printing_hash.feature
table_print-1.3.2 features/printing_hash.feature
table_print-1.3.1 features/printing_hash.feature
table_print-1.3.0 features/printing_hash.feature
table_print-1.2.0 features/printing_hash.feature