guard / guard-cucumber

Guard::Cucumber automatically run your features (much like autotest)
https://rubygems.org/gems/guard-cucumber
MIT License
86 stars 36 forks source link

Guard::Cucumber::NotificationFormatter fails on Cucumber 4.0.0 #41

Open todd-a-jacobs opened 4 years ago

todd-a-jacobs commented 4 years ago

Several tests related to the NotificationFormatter fail with Cucumber 4.0.0. It appears that Cucumber 4.x removed classes and methods that were relied on by guard-cucumber:

  1. Cucumber::Core::Ast
  2. Cucumber::Runtime#steps

The spec errors are reproduced below.

$ bundle exec rspec
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 58616
.............................................FFF..............

Failures:

  1) Guard::Cucumber::NotificationFormatter#step_name when failure is in a background step notifies with a valid feature name
     Failure/Error: instance_double(Cucumber::Core::Ast::Feature, name: "feature1")

     NameError:
       uninitialized constant Cucumber::Core::Ast
     # ./spec/guard/cucumber/notification_formatter_spec.rb:30:in `block (3 levels) in <top (required)>'
     # ./spec/guard/cucumber/notification_formatter_spec.rb:34:in `block (3 levels) in <top (required)>'

  2) Guard::Cucumber::NotificationFormatter#step_name with a buggy Background implementation correctly gets the feature name
     Failure/Error: instance_double(Cucumber::Core::Ast::Feature, name: "feature1")

     NameError:
       uninitialized constant Cucumber::Core::Ast
     # ./spec/guard/cucumber/notification_formatter_spec.rb:30:in `block (3 levels) in <top (required)>'
     # ./spec/guard/cucumber/notification_formatter_spec.rb:34:in `block (3 levels) in <top (required)>'

  3) Guard::Cucumber::NotificationFormatter after all features formats the notification
     Failure/Error: allow(mother).to receive(:steps).with(:passed).and_return([step])
       the Cucumber::Runtime class does not implement the instance method: steps
     # ./spec/guard/cucumber/notification_formatter_spec.rb:11:in `block (3 levels) in <top (required)>'

Finished in 0.09354 seconds (files took 2.13 seconds to load)
62 examples, 3 failures

Failed examples:

rspec ./spec/guard/cucumber/notification_formatter_spec.rb:47 # Guard::Cucumber::NotificationFormatter#step_name when failure is in a background step notifies with a valid feature name
rspec ./spec/guard/cucumber/notification_formatter_spec.rb:62 # Guard::Cucumber::NotificationFormatter#step_name with a buggy Background implementation correctly gets the feature name
rspec ./spec/guard/cucumber/notification_formatter_spec.rb:18 # Guard::Cucumber::NotificationFormatter after all features formats the notification

Randomized with seed 58616
ozzyaaron commented 3 years ago

Just in case this has prevented people attempting a Cucumber upgrade, it appears that you can just disable this notifier by adding notification: false in the guard cucumber setup: https://github.com/guard/guard-cucumber#list-of-available-options

That's letting me upgrade to Cucumber 5.x and still use guard.

cbroult commented 2 years ago

Just in case this has prevented people attempting a Cucumber upgrade, it appears that you can just disable this notifier by adding notification: false in the guard cucumber setup: https://github.com/guard/guard-cucumber#list-of-available-options

That's letting me upgrade to Cucumber 5.x and still use guard.

Same here w/ Cucumber 8.x.