Feature: Aruba Console

  Background:
    Given a mocked home directory

  Scenario: Start console
    Given I run `aruba console` interactively
    When I close the stdin stream
    Then the output should contain:
    """
    aruba:001:0>
    """

  Scenario: Show help
    Given I run `aruba console` interactively
    And I type "aruba_help"
    When I close the stdin stream
    Then the output should contain:
    """
    Version:
    """
    And the output should contain:
    """
    Issue Tracker:
    """
    And the output should contain:
    """
    Documentation:
    """

  Scenario: Show methods
    Given I run `aruba console` interactively
    And I type "aruba_methods"
    When I close the stdin stream
    Then the output should contain:
    """
    Methods:
    """
    And the output should contain:
    """
    * setup_aruba
    """

  Scenario: Has history
    Given I run `aruba console` interactively
    And I type "aruba_methods"
    And I type "exit"
    When I close the stdin stream
    Then the file "~/.aruba_history" should exist

Feature: Aruba Console

  Background:
    Given a mocked home directory

  Scenario: Start console
    Given I run `aruba console` interactively
    When I close the stdin stream
    Then the output should contain:
    """
    aruba:001:0>
    """

  Scenario: Show help
    Given I run `aruba console` interactively
    And I type "aruba_help"
    When I close the stdin stream
    Then the output should contain:
    """
    Version:
    """
    And the output should contain:
    """
    Issue Tracker:
    """
    And the output should contain:
    """
    Documentation:
    """

  Scenario: Show methods
    Given I run `aruba console` interactively
    And I type "aruba_methods"
    When I close the stdin stream
    Then the output should contain:
    """
    Methods:
    """
    And the output should contain:
    """
    * setup_aruba
    """

  Scenario: Has its own history file
    Given I run `aruba console` interactively
    And I type "IRB.conf[:HISTORY_FILE]"
    And I type "exit"
    When I close the stdin stream
    Then the output should contain:
    """
    ~/.aruba_history
    """

Update scenario to pass on Ruby 2.7
Update scenario to pass on Ruby 2.7

When running under childprocess, IRB does not activate readline. This
means history is not collected and the history file is empty if saved.
In Ruby 2.7, the file is not even written to. This means saving the
history file cannot properly be tested on Ruby 2.7 using Aruba. Instead,
we check that the correct file is configured in IRB, and just assume IRB
will do the right thing with it.
