Skip to content

Commit

Permalink
update and lock guard at 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwahler committed Jun 23, 2012
1 parent bdffbe9 commit 9242c3d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 19 deletions.
31 changes: 22 additions & 9 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
require 'rbconfig'
WINDOWS = RbConfig::CONFIG['host_os'] =~ /msdos|mswin|win32|mingw/i unless defined?(WINDOWS)

notification :off

# @examples
#
# guard --group specs
# guard --group features
#
group :specs do
group :rspec do
guard 'rspec',
:all_after_pass => false,
:all_on_start => false,
:cli => '--color --format nested --fail-fast',
#:cli => '--color --format nested --fail-fast',
:cli => '--color --format nested',
:version => 2 do

watch(%r{^spec/.+_spec\.rb$})
Expand All @@ -21,17 +27,24 @@ group :specs do
end
end

group :features do
group :cucumber do

opts = []
opts << ["--color"]
opts << ["--format pretty"]
opts << ["--strict"]
opts << ["-r features"]
opts << ["--no-profile"]
#opts << ["--tags @focus"]
opts << ["--tags ~@wip"]
opts << ["--tags ~@windows"] unless WINDOWS
opts << ["--tags ~@posix"] if WINDOWS

guard 'cucumber',
# focus on wip
#:cli => '--color --format pretty --profile wip',
# normal, ignore wip
:cli => '--color --format pretty --strict --tags ~wip',
:cli => opts.join(" "),
:all_after_pass => false,
:all_on_start => false 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
end
16 changes: 15 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
require 'bundler/setup'
require 'bundler/gem_tasks'

require 'rbconfig'
WINDOWS = RbConfig::CONFIG['host_os'] =~ /msdos|mswin|win32|mingw/i unless defined?(WINDOWS)

require 'rspec/core/rake_task'
desc "Run RSpec"
RSpec::Core::RakeTask.new do |spec|
Expand All @@ -13,7 +16,18 @@ end

require 'cucumber/rake/task'
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{}

opts = []
opts << ["--color"]
opts << ["--format pretty"]
opts << ["--strict"]
opts << ["-r features"]
opts << ["--no-profile"]
opts << ["--tags ~@wip"]
opts << ["--tags ~@windows"] unless WINDOWS
opts << ["--tags ~@posix"] if WINDOWS

t.cucumber_opts = opts
end

desc "Run specs, both RSpec and Cucumber"
Expand Down
13 changes: 9 additions & 4 deletions basic_gem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ Gem::Specification.new do |s|

# guard, watches files and runs specs and features
#
# @see Gemfile for platform specific dependencies
s.add_development_dependency "guard", "~> 1.0"
s.add_development_dependency "guard-rspec", "~> 0.6"
s.add_development_dependency "guard-cucumber", "~> 0.7.5"
# Guard is locked at 1.0.3 due to high CPU usage after returning from screen
# lock on Ubuntu 11.04. Wait for the 1+ version of Guard to mature and listen
# gem fixes are applied
#
# https://github.com/guard/listen/issues/44
#
s.add_development_dependency "guard", "= 1.0.3"
s.add_development_dependency "guard-rspec", "~> 0.7"
s.add_development_dependency "guard-cucumber", "~> 0.8"

s.files = gemfiles.split("\n")
s.executables = gemfiles.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
Expand Down
24 changes: 19 additions & 5 deletions cucumber.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
<%
require 'rbconfig'
WINDOWS = RbConfig::CONFIG['host_os'] =~ /msdos|mswin|win32|mingw/i unless defined?(WINDOWS)
opts = []
opts << ["--color"]
opts << ["--format pretty"]
opts << ["--strict"]
opts << ["-r features"]
opts << ["--no-profile"]
opts << ["--tags ~@wip"]
opts << ["--tags ~@windows"] unless WINDOWS
opts << ["--tags ~@posix"] if WINDOWS
std_opts = opts.join(' ')
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format pretty" : "--format pretty #{rerun}"
%>
# define cucumber profiles
#
# Example usage:
#
# bundle exec cucumber --profile wip
---
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format pretty" : "--format pretty #{rerun}"
std_opts = "--format pretty --tags ~@wip"
%>
default: <%= std_opts %> -r features
wip: --tags @wip:3 --wip -r features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip -r features

0 comments on commit 9242c3d

Please sign in to comment.