Test-Kitchen serverspec testing exception on windows - windows

When using chef generate cookbook hello command, the serverspec spec_helper.rb file generated will not work with Test-Kitchen 1.4.1 and windows.
kitchen verify command will throw the following on windows platform:
C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/backend/exec.rb:98:in `spawn': No such file or directory - /bin/sh -c ls\ /etc/arch-release (Errno::ENOENT)
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/backend/exec.rb:98:in `spawn_command'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/backend/exec.rb:13:in `block in run_command'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/backend/exec.rb:133:in `with_env'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/backend/exec.rb:12:in `run_command'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/helper/detect_os.rb:13:in `run_command'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/helper/detect_os/arch.rb:3:in `detect'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/helper/detect_os.rb:5:in `detect'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/helper/os.rb:24:in `block in detect_os'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/helper/os.rb:23:in `each'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/helper/os.rb:23:in `detect_os'
from C:/Users/vagrant/AppData/Local/Temp/verifier/gems/gems/specinfra-2.37.5/lib/specinfra/helper/os.rb:9:in `os'
from C:/Users/vagrant/AppData/Local/Temp/verifier/suites/serverspec/windows_spec.rb:4:in `<top (required)>'

Changing the test-kitchen spec_helper.rb file to test for windows and setting the backend and os accordingly, fixes the issue:
require 'serverspec'
if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil?
set :backend, :exec
else
set :backend, :cmd
set :os, family: 'windows'
end
You can then test against different platforms, for example:
require 'spec_helper'
case os[:family]
when 'windows'
describe file('C:\Users\vagrant\foo.txt') do
it { should be_file }
end
when 'darwin' # mac os x
describe file('/user/vagrant/foo.txt') do
it { should be_file }
end
when 'ubuntu'
describe file('/home/vagrant/foo.txt') do
it { should be_file }
end
end

Related

How can I force Rspec to not falsely think another module is nested inside the parent?

I have an issue that's appearing only when running rspec, my application loads and works fine locally and in production
rspec seems to think that the gem JWT belongs to my module BACKBONE
An error occurred while loading spec_helper.
Failure/Error: JWT.encode(payload, ENV['APP_SECRET'], 'HS256')
NameError:
uninitialized constant BACKBONE::JWT
# ./lib/jwt.rb:6:in `encode'
# ./lib/backbone/policies.rb:7:in `<class:Policy>'
# ./lib/backbone/policies.rb:5:in `<module:BACKBONE>'
# ./lib/backbone/policies.rb:3:in `<top (required)>'
# ./init.rb:10:in `load'
# ./init.rb:10:in `block in <module:CrewManagement>'
# ./init.rb:10:in `glob'
# ./init.rb:10:in `<module:CrewManagement>'
# ./init.rb:4:in `<top (required)>'
# ./spec/spec_helper.rb:16:in `require'
# ./spec/spec_helper.rb:16:in `<top (required)>'
files are listed in the order they are loaded into memory, it may be useful to note that I have several other applications with the same setup that are not experiencing this issue
/spec/spec_helper.rb
require 'bundler'
require 'simplecov'
SimpleCov.start
Bundler.require :default
Dotenv.load("./.env.#{(ENV['RACK_ENV'] || 'development')}")
require 'rack/test'
require './init'
# ...
/init.rb
module CrewManagement
## ...
Dir.glob('./lib/**/*.rb') { |file| load file }
## ...
end
/lib/jwt.rb
module BACKBONE
def self.encode(payload)
JWT.encode(payload, ENV['APP_SECRET'], 'HS256')
end
def self.decode(token)
JWT.decode(token, ENV['APP_SECRET'], true, algorithm: 'HS256')
end
end
/lib/backbone/policies.rb
module BACKBONE
headers = { 'Authorization' => BACKBONE.encode(app: '...') }
end

rspec bugs when trying to run rake

I'm trying to teach myself some ruby using the app academy tutorials and after doing the readings, installing rvm,rubygems and rspec2 when I even try to run the first most basic code (00_hello) with rake I get the whole error :
(in /home/deadpool/Documents/learn_ruby)
/home/deadpool/Documents/learn_ruby/rspec_config.rb:3:in `block in <top (required)>': undefined method `color=' for #<RSpec::Core::Configuration:0x0000000293dee0> (NoMethodError)
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core.rb:67:in `configure'
from /home/deadpool/Documents/learn_ruby/rspec_config.rb:1:in `<top (required)>'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/configuration.rb:162:in `require'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/configuration.rb:162:in `block in requires='
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/configuration.rb:162:in `map'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/configuration.rb:162:in `requires='
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/configuration_options.rb:22:in `block in configure'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/configuration_options.rb:21:in `each'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/configuration_options.rb:21:in `configure'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/command_line.rb:17:in `run'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:55:in `run_in_process'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:46:in `run'
from /home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!
ruby -S bundle exec rspec -I/home/deadpool/Documents/learn_ruby/00_hello -I/home/deadpool/Documents/learn_ruby/00_hello/solution -f documentation -r ./rspec_config "/home/deadpool/Documents/learn_ruby/00_hello/hello_spec.rb" failed
/home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/rake_task.rb:117:in `rescue in block (2 levels) in initialize'
/home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/rake_task.rb:113:in `block (2 levels) in initialize'
/home/deadpool/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-2.0.0/lib/rspec/core/rake_task.rb:109:in `block in initialize'
Tasks: TOP => default => spec
(See full trace by running task with --trace)
I tried to google some of the errors, but with no success. I had previously another error with the rake file using rspec v2 and the current version is 3.0.0, so I had to install the older and I think it might be another setup problem. Thanks if someone can help me or direct me.
rspec_config.rb file :
RSpec.configure do |c|
c.fail_fast = true
c.color = true
end
hello.rb file:
def hello
"Hello!"
end
def greet(who)
"Hello, #{who}!"
end
UPDATE
Getting new error as :-
While I changed c.color = true to c.color_enabled = true
(in /home/deadpool/Documents/learn_ruby)
the hello function says hello (FAILED - 1)
Failures: 1) the hello function says hello Failure/Error:
Unable to find matching line from backtrace undefined method run_all' for []:Array
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/hooks.rb:116:inrun_hook_filtered'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/example_group.rb:176:in eval_before_alls'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/example_group.rb:231:inrun'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/command_line.rb:26:in block (2 levels) in run'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/command_line.rb:26:inmap'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/command_line.rb:26:in block in run'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/reporter.rb:11:inreport'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/command_line.rb:23:in run'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:55:inrun_in_process'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:46:in run'
# /home/deadpool/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:10:inblock in autorun'
UPDATE
hello_spec.rb file :
require "hello"
describe "the hello function" do
it "says hello" do
hello.should == "Hello!"
end
end
describe "the greet function" do
it "says hello to someone" do
greet("Alice").should == "Hello, Alice!"
end
it "says hello to someone else" do
greet("Bob").should == "Hello, Bob!"
end
end
UPDATE
So, I updated rspec to v3.0.0 and changed Rakefile gem 'rspec', '~>3.0.0' and c.color = true back. Everything is working now(getting some deprecation warnings, but nothing critical), getting the output that is in the tutorial. Guess I just had to updae my rspec and change the version in the Rakefile. Thank you so much :)
Your error log is showing you are in rspec-core-2.0.0 version and your error is saying -
rspec_config.rb:3:in `block in <top (required)>': undefined method `color=' for
#<RSpec::Core::Configuration:0x0000000293dee0> (NoMethodError)
Now Deprecate config options confirms that below versions of 2.99.0.rc1 / 2014-05-18 or 2.99.0 methods were - #color_enabled, #color_enabled= and #color?. Which are changed since 2.99.0 to #color, #color= and #color_enabled?.
I got the information from the changelog as I linked -
Deprecate #color_enabled, #color_enabled= and #color? in favour of #color, #color= and #color_enabled? output. (Jon Rowe)
Thus you need to write as
RSpec.configure do |c|
c.fail_fast = true
c.color_enabled = true
end
Regarding your new error, I found it as a bug undefined methodrun_all' for []:Array`. Which has been fixed in this patch. Check this Rspec issue.
My suggestion use Rspec 3.0, at least you will be happy. In this case revert the color_enabled to color.
Hope this would help you.

undefined method `infer_base_class_for_anonymous_controllers=' for #<RSpec::Core::Configuration:0x007f7fb3a62b80> (NoMethodError)

I'm currently on Chapter 7 of Hartl's Tutorial, and every time I run
bundle exec rspec spec/
the following results:
/Users/siciliana/sample_app/spec/spec_helper.rb:31:in `block in <top (required)>': undefined method `infer_base_class_for_anonymous_controllers=' for #<RSpec::Core::Configuration:0x007f7fb3a62b80> (NoMethodError)
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core.rb:79:in `configure'
from /Users/siciliana/sample_app/spec/spec_helper.rb:11:in `<top (required)>'
from /Users/siciliana/sample_app/spec/models/user_spec.rb:12:in `require'
from /Users/siciliana/sample_app/spec/models/user_spec.rb:12:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `block in load_spec_files'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `map'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load_spec_files'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in `run'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
from /usr/local/rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `block in autorun'
Can someone please explain what is happening here to an absolute newbie?
spec_helper.rb :
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
#
RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = "random"
end
I was getting the same error (although not following the tutorial).
I believe this setting requires 'rspec/rails'
My solution was to move the line
config.infer_base_class_for_anonymous_controllers = # whatever
From spec_helper.rb to rails_helper.rb.

Thor YAML.load_file invalid subclass (TypeError)

I'm creating a thor script that shows the current project I am on based on a yml file that stores Ruby structures. I'm getting an error when I tried to load this yml file.
from /Users/cpara/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:135:in `node_import'
from /Users/cpara/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:135:in `load'
from /Users/cpara/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:135:in `load'
from /Users/cpara/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:146:in `block in load_file'
from /Users/cpara/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:145:in `open'
from /Users/cpara/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/syck.rb:145:in `load_file'
from ./project:84:in `current'
from /Users/cpara/.rvm/gems/ruby-1.9.2-p318#rails/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/cpara/.rvm/gems/ruby-1.9.2-p318#rails/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/cpara/.rvm/gems/ruby-1.9.2-p318#rails/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Users/cpara/.rvm/gems/ruby-1.9.2-p318#rails/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from ./project:213:in `<main>'
Here is the piece of the script I'm trying to run:
#!/usr/bin/env ruby
require 'yaml'
class Project < Thor
include Thor::Actions
# Task: return current project
desc 'current', 'Shows current project.'
def current
projects = YAML.load_file "#{ENV['HOME']}/.hana/data/projects.yml" #error
abort "There are no projects. Try creating one first." if not #projects.is_a? Array
projects.each do |project|
if project.current == true
say_status :current, "Current project: #{project.name} // #{project.type} // #{project.version}", :green
return project
end
end
say_status :error, "There is no current project.", :red
end
end
I've triple checked the path in irb and it does exist. I thought it was the way my YAML was storing my Ruby structure but even the console, I get the error. Here is my YAML file
---
- !ruby/struct:Proj
name: test
type: testing
version: 4.0.2
deploy_dir: deploy
source_dir: source
current: true
Any ideas? I'm running Ruby 1.9.2p318.
YAML is trying to instanciate a Struct named Proj from the file as indicated by the line:
!ruby/struct:Proj
You should require the file where you haved defined Proj before loading the yaml. Or, just to test if it works, in your code, after the require 'yaml' line define Proj:
Proj = Struct.new(:name, :type, :version, :deploy_dir, :source_dir, :current)

How to setup Cucumber, Guard & Spork with Rails 3.1?

I'm trying to setup cucumber, rspec, guard and spork. I've got rspec working fine but cucumber crashes with the trace below.
I've try setting this up several times,
rails g cucumber:install --spork
spork cucumber --boostrap
etc... with no luck.
Gems:
rails (3.1.3)
guard (0.10.0)
guard-bundler (0.1.3)
guard-cucumber (0.7.4, 0.7.3)
guard-rails (0.0.3)
guard-rspec (0.6.0, 0.5.2)
guard-spork (0.5.1, 0.5.0)
cucumber (1.1.4)
cucumber-rails (1.2.1)
spork (0.9.0)
Running all features
Using the default profile...
Running tests with args ["--color", "--format", "pretty", "--require", "/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/guard-cucumber-0.7.4/lib/guard/cucumber/notification_formatter.rb", "--format", "Guard::Cucumber::NotificationFormatter", "--out", "/dev/null", "--require", "features", "features", "--format", "pretty", "--strict", "--tags", "~#wip", "features", "--no-profile"]...
Disabling profiles...
Exception encountered: #<RuntimeError: All but one formatter must use --out, only one can print to each stream (or STDOUT)>
backtrace:
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/cucumber-1.1.4/lib/cucumber/cli/configuration.rb:198:in `arrange_formats'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/cucumber-1.1.4/lib/cucumber/cli/configuration.rb:26:in `parse!'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/cucumber-1.1.4/lib/cucumber/cli/main.rb:55:in `configuration'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/cucumber-1.1.4/lib/cucumber/cli/main.rb:63:in `run_drb_client'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/cucumber-1.1.4/lib/cucumber/cli/main.rb:34:in `execute!'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb:24:in `run_tests'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/run_strategy/forking.rb:13:in `block in run'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/forker.rb:21:in `block in initialize'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/forker.rb:18:in `fork'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/forker.rb:18:in `initialize'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/matt/.rvm/gems/ruby-1.9.2-p290#alphascore/gems/spork-0.9.0/lib/spork/server.rb:48:in `run'
/Users/matt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1558:in `perform_without_block'
/Users/matt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1518:in `perform'
/Users/matt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1592:in `block (2 levels) in main_loop'
/Users/matt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1588:in `loop'
/Users/matt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/drb/drb.rb:1588:in `block in main_loop'
Done.
I finally solved this, after playing around with flags passed to cucumber via my guardfile I was able to resolve conflicting flags and not overriding my cucumber.yml flags.
Working Guardfile
guard 'cucumber', :cli => "--drb" do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { 'features' }
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end
cucumber.yml
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~#wip"
%>
default: --drb <%= std_opts %> features
wip: --drb --tags #wip:3 --wip features
rerun: --drb <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~#wip
Conflicting Guardfile
guard 'cucumber', :cli => "--drb --color --format pretty" do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { 'features' }
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end

Resources