Sha256: 0994fe23cd9508e65a10ebf0acc60ec46880a7b447e55f60165345f4d4d58829

Contents?: true

Size: 1.61 KB

Versions: 15

Compression:

Stored size: 1.61 KB

Contents

Feature: Adding columns
  Scenario: With the :include option
    Given a class named Foo
    Given Foo has attributes herp, blog

    Given a class named Foo::Blog
    Given Foo::Blog has attributes title, author
    Given Foo::Blog has a class method named foo with lambda{"just testing!"}
    Given Foo::Blog has a method named two_args with lambda{|a, b| "Called with #{a}, #{b}"}

    When I instantiate a Foo with {:herp => "derp"}
    When I instantiate a Foo::Blog with {:title => "post!", :author => 'Ryan'} and assign it to foo.blog
    And table_print Foo, {:include => ["blog.author", "blog.title"]}
    Then the output should contain
    """
    HERP | BLOG.AUTHOR | BLOG.TITLE
    -----|-------------|-----------
    derp | Ryan        | post!
    """

  Scenario: Providing a named proc
    Given a class named Blog

    Given Blog has attributes title, author

    When I instantiate a Blog with {:title => "post!", :author => 'Ryan'}
    And table_print Blog, {:wombat => {:display_method => lambda{|blog| blog.author.gsub(/[aeiou]/, "").downcase}}}
    Then the output should contain
    """
    WOMBAT
    ------
    ryn
    """
  Scenario: Providing a named proc without saying 'display_method', eg :foo => lambda{}
    Given a class named Blog

    Given Blog has attributes title, author

    When I instantiate a Blog with {:title => "post!", :author => 'Ryan'}
    And table_print Blog, {:wombat => lambda{|blog| blog.author.gsub(/[aeiou]/, "").downcase}}
    Then the output should contain
    """
    WOMBAT
    ------
    ryn
    """
  Scenario: Using a proc as a filter (ie, overriding an existing column with a proc)

Version data entries

15 entries across 15 versions & 1 rubygems

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