Feature: Basic UI functionality Scenario: App just runs When I get help for "acmcommits" Then the exit status should be 0 And the banner should be present Scenario: Enable in a naked git repository Given a git repository named "test" with no "post-commit" hook When I cd to "test" And I successfully run `acmcommits --enable` Then the output should contain "installed acmcommit hook as:" And the output should contain "(to remove later, you can use: acmcommits --disable)" And a file named ".git/hooks/post-commit" should exist And the exit status should be 0 Scenario: Disable in a enabled git repository Given I am in a git repository named "lolenabled" with acmcommits enabled When I successfully run `acmcommits --disable` Then the output should contain "removed" And a file named ".git/hooks/post-commit" should not exist And the exit status should be 0 Scenario: Trying to enable while not in a git repo fails Given I am in a directory named "svnrulez" When I run `acmcommits --enable` Then the output should contain "You don't appear to be in the base directory of a git project." And the exit status should be 1 Scenario: Commiting in an enabled repo triggers successful capture Given I am in a git repository named "testcapture" with acmcommits enabled When I do a git commit Then the output should contain "*** Preserving this moment in history." And a directory named "../.acmcommits/testcapture" should exist And a file named "../.acmcommits/testcapture/tmp_snapshot.jpg" should not exist And there should be exactly 1 jpg in "../.acmcommits/testcapture" Scenario: Commiting in an enabled repo subdirectory triggers successful capture of parent repo Given I am in a git repository named "testcapture" with acmcommits enabled And a directory named "subdir" And an empty file named "subdir/FOOBAR" When I cd to "subdir/" And I do a git commit Then the output should contain "*** Preserving this moment in history." And a directory named "../../.acmcommits/testcapture" should exist And a directory named "../../.acmcommits/subdir" should not exist And there should be exactly 1 jpg in "../../.acmcommits/testcapture" Scenario: Show plugins When I successfully run `acmcommits --plugins` Then the output should contain a list of plugins # # a stab at recreating ken's scenarios with native aruba steps, not quite there yet in terms # of elegance, but its passing so might as well leave in for now. # Scenario: Configuring plugin (with native aruba steps) Given a git repository named "config-test" When I cd to "config-test" And I run `acmcommits --config` interactively When I type "loltext" When I type "true" Then the output should contain a list of plugins And the output should contain "Name of plugin to configure:" Then the output should contain "enabled:" Then the output should contain "Successfully Configured" And a file named "../.acmcommits/config-test/config.yml" should exist When I successfully run `acmcommits --show-config` Then the output should contain "loltext:" And the output should contain "enabled: true" Scenario: Configuring Plugin Given a git repository named "config-test" When I cd to "config-test" And I run `acmcommits --config` and wait for output When I enter "loltext" for "Name of plugin to configure" And I enter "true" for "enabled" Then I should be presented "Successfully Configured" And a file named "../.acmcommits/config-test/config.yml" should exist When I successfully run `acmcommits --show-config` Then the output should contain "loltext:" And the output should contain "enabled: true" Scenario: Configuring Plugin In Test Mode Given a git repository named "testmode-config-test" When I cd to "testmode-config-test" And I run `acmcommits --config --test` and wait for output And I enter "loltext" for "Name of plugin to configure" And I enter "true" for "enabled" Then I should be presented "Successfully Configured" And a file named "../.acmcommits/test/config.yml" should exist When I successfully run `acmcommits --test --show-config` Then the output should contain "loltext:" And the output should contain "enabled: true" Scenario: test capture should work regardless of whether in a git repository Given I am in a directory named "nothingtoseehere" When I run `acmcommits --test --capture` Then the output should contain "*** Capturing in test mode." And the output should not contain "path does not exist (ArgumentError)" And the exit status should be 0 Scenario: test capture should store in its own test directory Given I am in a git repository named "randomgitrepo" with acmcommits enabled When I successfully run `acmcommits --test --capture` Then a directory named "../.acmcommits/test" should exist And a directory named "../.acmcommits/randomgitrepo" should not exist Scenario: last command should work properly when in a lolrepo Given a git repository named "randomgitrepo" And a loldir named "randomgitrepo" with 2 lolimages And I cd to "randomgitrepo" When I run `acmcommits --last` Then the exit status should be 0 Scenario: last command should fail gracefully if not in a lolrepo Given I am in a directory named "gitsuxcvs4eva" When I run `acmcommits --last` Then the output should contain "Can't do that since we're not in a valid git repository!" And the exit status should be 1 Scenario: last command should fail gracefully if zero lolimages in lolrepo Given a git repository named "randomgitrepo" And a loldir named "randomgitrepo" with 0 lolimages And I cd to "randomgitrepo" When I run `acmcommits --last` Then the output should contain "No acmcommits have been captured for this repository yet." Then the exit status should be 1 Scenario: browse command should work properly when in a lolrepo Given a git repository named "randomgitrepo" And a loldir named "randomgitrepo" with 2 lolimages And I cd to "randomgitrepo" When I run `acmcommits --browse` Then the exit status should be 0 Scenario: browse command should fail gracefully when not in a lolrepo Given I am in a directory named "gitsuxcvs4eva" When I run `acmcommits --browse` Then the output should contain "Can't do that since we're not in a valid git repository!" And the exit status should be 1 Scenario: handle commit messages with quotation marks Given I am in a git repository named "shellz" with acmcommits enabled When I successfully run `git commit --allow-empty -m 'i hate \"air quotes\" dont you'` Then the exit status should be 0 And there should be exactly 1 jpg in "../.acmcommits/shellz"