davetron5000 / optparse-plus

Start your command line scripts off right in Ruby
http://davetron5000.github.com/optparse-plus
Apache License 2.0
521 stars 54 forks source link

'rake features' fails due to 'should' depreciation #92

Closed lebogan closed 9 years ago

lebogan commented 9 years ago

I hope I'm not being a pain. This error is killing me:

Feature: Checkout dotfiles
  In order to get my dotfiles onto a new computer
  I want a one-command way to keep them up to date
  So I don't have to do it myself

  Scenario: Basic UI
    When I get help for "fullstop"
    Then the exit status should be 0
    And the banner should be present
DEPRECATION: Using `should` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }` instead. Called from /home/lewisb/.rvm/gems/ruby-2.2-head/gems/methadone-1.9.0/lib/methadone/cucumber.rb:111:in `block in <top (required)>'.
    And there should be a one line summary of what the app does
      expected "Manage dotfiles from a git repo" to match /^\s*$/
      Diff:
      @@ -1,2 +1,2 @@
      -/^\s*$/
      +"Manage dotfiles from a git repo"
       (RSpec::Expectations::ExpectationNotMetError)
      features/fullstop.feature:10:in `And there should be a one line summary of what the app does'
    And the banner should document that this app takes options
    And the banner should include the version
    And the banner should document that this app's arguments are:
      | repo_url | which is required |

Failing Scenarios:
cucumber features/fullstop.feature:6

1 scenario (1 failed)
7 steps (1 failed, 3 skipped, 3 passed)
0m0.214s

Seems to be another one of those times when a gem has been updated with new features that break everything else around it :-(

davetron5000 commented 9 years ago

Hmm. It's possible that new versions of this libs break these tests.

You can add @announce to a feature to show the command line output, e.g.

  @announce
  Scenario: Basic UI
    When I get help for "fullstop"
    Then the exit status should be 0
    ...

Can you try that and post what happens?

(And no, you are not being a pain :)

lebogan commented 9 years ago
$ rake features
Feature: Checkout dotfiles
  In order to get my dotfiles onto a new computer
  I want a one-command way to keep them up to date
  So I don't have to do it myself

$ cd /home/lewisb/src/ruby/sandbox/methadone/fullstop/tmp/aruba
$ fullstop --help
Usage: fullstop [options] repo_url
Manage dotfiles from a git repo

Options:
    -h, --help                       Show command line help
        --version                    Show help/version info
        --log-level LEVEL            Set the logging level
                                     (debug|info|warn|error|fatal)
                                     (Default: info)

Arguments:

    repo_url
        URL to the git repository containing your dotfiles

  @announce
  Scenario: Basic UI
    When I get help for "fullstop"
    Then the exit status should be 0
    And the banner should be present
DEPRECATION: Using `should` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }` instead. Called from /home/lewisb/.rvm/gems/ruby-2.2-head/gems/methadone-1.9.0/lib/methadone/cucumber.rb:111:in `block in <top (required)>'.
    And there should be a one line summary of what the app does
      expected "Manage dotfiles from a git repo" to match /^\s*$/
      Diff:
      @@ -1,2 +1,2 @@
      -/^\s*$/
      +"Manage dotfiles from a git repo"
       (RSpec::Expectations::ExpectationNotMetError)
      features/fullstop.feature:11:in `And there should be a one line summary of what the app does'
    And the banner should document that this app takes options
    And the banner should include the version
    And the banner should document that this app's arguments are:
      | repo_url | which is required |

Failing Scenarios:
cucumber features/fullstop.feature:7

1 scenario (1 failed)
7 steps (1 failed, 3 skipped, 3 passed)
0m0.215s
davetron5000 commented 9 years ago

That is weird—you can see that it's outputting the string the test is looking for. Let me try it locally…

davetron5000 commented 9 years ago

I was not able to recreate this, but did notice other odd failures on a fresh app. See #91 for how you can test out my changes

lebogan commented 9 years ago

That worked! I still get the depreciation warning about 'expect' instead of 'should', but the steps all pass. Thank you. I'll take that warning issue on myself as a personal challenge.

$ bundle install Resolving dependencies... Using rake 10.4.2 Using ffi 1.9.8 Using childprocess 0.5.6 Using builder 3.2.2 Using multi_json 1.11.0 Using gherkin 2.12.2 Using cucumber-core 1.1.3 Using diff-lcs 1.2.5 Using multi_test 0.1.2 Using cucumber 2.0.0 Using rspec-support 3.2.2 Using rspec-expectations 3.2.1 Using aruba 0.6.2 Using bundler 1.9.9 Using fullstop 0.1.0 from source at . Using methadone 1.9.0 from git://github.com/davetron5000/methadone.git (at fix-test-unit-issue-for-2.2) Using power_assert 0.2.3 Using rdoc 4.2.0 Using test-unit 3.0.9

$ bundle exec rake Loaded suite /home/lewisb/.rvm/rubies/ruby-2.2-head/lib/ruby/2.2.0/rake/rake_test_loader Started .

Finished in 0.000335744 seconds.

1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications

100% passed

2978.46 tests/s, 2978.46 assertions/s Feature: Checkout dotfiles In order to get my dotfiles onto a new computer I want a one-command way to keep them up to date So I don't have to do it myself

$ cd /home/lewisb/src/ruby/sandbox/methadone/fullstop/tmp/aruba $ fullstop --help Usage: fullstop [options] repo_url

Manage dotfiles from a git repo

v0.1.0

Options: -h, --help Show command line help --version Show help/version info --log-level LEVEL Set the logging level (debug|info|warn|error|fatal) (Default: info)

Arguments:

repo_url
    URL to the git repository containing your dotfiles

@announce Scenario: Basic UI When I get help for "fullstop" Then the exit status should be 0 And the banner should be present DEPRECATION: Using should from rspec-expectations' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should with config.expect_with(:rspec) { |c| c.syntax = :should } instead. Called from /home/lewisb/.rvm/gems/ruby-2.2-head/bundler/gems/methadone-060234aa5b60/lib/methadone/cucumber.rb:111:in `block in <top (required)>'. And there should be a one line summary of what the app does And the banner should document that this app takes options And the banner should include the version And the banner should document that this app's arguments are: | repo_url | which is required |

1 scenario (1 passed) 7 steps (7 passed) 0m0.216s

On Mon, 2015-05-25 at 15:37 -0700, David Copeland wrote:

I was not able to recreate this, but did notice other odd failures on a fresh app. See #91 for how you can test out my changes

— Reply to this email directly or view it on GitHub.

davetron5000 commented 9 years ago

Version 1.9.1 should have changes that improve or even fix this. Re-open if not.

Luminus commented 8 years ago

Hey @davetron5000,

Thanks for the amazing work here.

I'm having a similar issue but the error is coming at the exit status line and I'm at a loss as to how to resolve it.

Running the app using bundle exec works, but the tests keep failing so I won't know if something messes up and I can't go TDD with it behaving this way.

Here's the output I get when I run the tests.

Feature: My bootstrapped app kinda works
  In order to get going on coding my awesome app
  I want to have aruba and cucumber setup
  So I don't have to do it myself

  Scenario: App just runs
    When I get help for "fullstop"
    Then the exit status should be 0
      expected that command "fullstop --help" has exit status of "0", but has "1".  (RSpec::Expectations::ExpectationNotMetError)
      features/fullstop.feature:8:in `Then the exit status should be 0'
    And the banner should be present
    And the banner should document that this app takes options
    And the following options should be documented:
      | --version |
    And the banner should document that this app takes no arguments

Failing Scenarios:
cucumber features/fullstop.feature:6

1 scenario (1 failed)
6 steps (1 failed, 4 skipped, 1 passed)
0m0.473s

I have methadone 1.9.2, ruby 2.2.3, rbenv 0.4.0

davetron5000 commented 8 years ago

Can you add @announce right above Scenario and post what happens? That should cause cucumber to output the stdout and stderr of fullstop to hopefully explain why it's exiting with 1 and not zero.

@announce
Scenario: App just runs
wazoo commented 8 years ago

So, I also ran into this today using methadone 1.9.2, ruby 2.2.1, rvm. I narrowed it down to when I added a specific test when going through the tutorial I posted a quick example, first commit is a bootstrap app, second commit shows the line added and 'rake features' throws the following:

Feature: My bootstrapped app kinda works
  In order to get going on coding my awesome app
  I want to have aruba and cucumber setup
  So I don't have to do it myself

  Scenario: App just runs
    When I get help for "fullstop"
    Then the exit status should be 0
    And the banner should be present
The use of "#all_output" is deprecated. Use `all_commands.map { |c| c.output }.join("\n") instead. If you need to check for some output use "expect(all_commands).to have_output /output/" instead. Called by /r/v/m/path/to/gemset/gems/methadone-1.9.2/lib/methadone/cucumber.rb:110:in `block in <top (required)>'
The use of "#process_monitor" is deprecated.. Called by /r/v/m/path/to/gemset/gems/aruba-0.14.0/lib/aruba/api/deprecated.rb:790:in `all_output'
DEPRECATION: Using `should` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }` instead. Called from /r/v/m/path/to/gemset/gems/methadone-1.9.2/lib/methadone/cucumber.rb:111:in `block in <top (required)>'.
    And there should be a one line summary of what the app does
      expected "v0.1.0" to match /^\w+\s+\w+/
      Diff:
      @@ -1,2 +1,2 @@
      -/^\w+\s+\w+/
      +"v0.1.0"
       (RSpec::Expectations::ExpectationNotMetError)
      features/fullstop.feature:10:in `And there should be a one line summary of what the app does'
    And the banner should document that this app takes options
    And the following options should be documented:
      | --version |
    And the banner should document that this app takes no arguments

Failing Scenarios:
cucumber features/fullstop.feature:6

1 scenario (1 failed)
7 steps (1 failed, 3 skipped, 3 passed)
0m0.367s

One interesting thing is that changing that makes it fail the version number check regex it looks like, weird. I am just going to omit that test to finish the tutorial for now, I will try to track it down after I finish the tutorial but I wanted to share in case it would help!