Skip to content

Commit

Permalink
Udpate gems
Browse files Browse the repository at this point in the history
  • Loading branch information
netzpirat committed Jan 9, 2012
1 parent a120174 commit 72a1bba
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 77 deletions.
19 changes: 11 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
source 'http://rubygems.org'
source :rubygems

# Specify your gem's dependencies in guard-cucumber.gemspec
gemspec

gem 'rake'

platform :ruby do
gem 'rb-readline'
end

require 'rbconfig'

if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'rb-fsevent', '>= 0.4.0'
gem 'growl', '~> 1.0.3'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.8.4'
gem 'libnotify', '~> 0.3.0'
gem 'ruby_gntp', '~> 0.3.4', :require => false
elsif RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'libnotify', '~> 0.7.1', :require => false
elsif RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
gem 'win32console', :require => false
gem 'rb-notifu', '>= 0.0.4', :require => false
end
4 changes: 2 additions & 2 deletions lib/guard/cucumber/inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def clear_cucumber_files_list
#
def included_in_other_path?(path, paths)
paths = paths.select { |p| p != path }
massaged = path[0...(path.index(":")||path.size)]
paths.any? { |p| (path.include?(p) && (path.gsub(p, '')).include?('/')) || massaged.include?(p) }
paths.any? { |p| path.include?(p) && (path.gsub(p, '')).include?('/') }
end

end
end
end
Expand Down
15 changes: 4 additions & 11 deletions lib/guard/cucumber/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
def run(paths, options = { })
return false if paths.empty?

message = options[:message] || (paths == ['features'] ? "Running all Cucumber features: #{ cucumber_command(paths, options) }" : "Running Cucumber features: #{ cucumber_command(paths, options) }")
message = options[:message] || (paths == ['features'] ? 'Run all Cucumber features' : "Run Cucumber features #{ paths.join(' ') }")
UI.info message, :reset => true

system(cucumber_command(paths, options))
Expand All @@ -38,8 +38,9 @@ def run(paths, options = { })
def cucumber_command(paths, options)
cmd = []
cmd << "rvm #{options[:rvm].join(',')} exec" if options[:rvm].is_a?(Array)
cmd << 'bundle exec' if (bundler? && options[:bundler] != false) || (bundler? && options[:binstubs].is_a?(TrueClass))
cmd << cucumber_exec(options)
cmd << 'bundle exec' if bundler? && options[:bundler] != false

cmd << 'cucumber'
cmd << options[:cli] if options[:cli]

if options[:notification] != false
Expand All @@ -53,14 +54,6 @@ def cucumber_command(paths, options)
(cmd + paths).join(' ')
end

# Simple test if binstubs prefix should be used.
#
# @return [String] Cucumber executable
#
def cucumber_exec(options = {})
options[:binstubs] == true && ( bundler? || options[:bundler] != false ) ? "bin/cucumber" : "cucumber"
end

# Simple test if bundler should be used. it just checks for the `Gemfile`.
#
# @return [Boolean] bundler exists
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/cucumber/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Guard
module CucumberVersion
# Guard::Cucumber version that is used for the Gem specification
VERSION = '0.7.4'
VERSION = '0.7.3'
end
end
16 changes: 0 additions & 16 deletions spec/guard/cucumber/inspector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
it 'removes duplicate paths' do
inspector.clean(['features', 'features']).should == ['features']
end

it 'removes individual feature tests if the path is already in paths to run' do
inspector.clean(['features/a.feature', 'features/a.feature:10']).should == ['features/a.feature']
end

it 'removes feature folders included in other feature folders' do
inspector.clean(['features/subfolder', 'features']).should == ['features']
Expand All @@ -38,16 +34,4 @@
inspector.clean(['features/subfolder/b.feature', 'features']).should == ['features']
end
end

describe ".included_in_other_path?" do
it "detects dups when a scenario is specified, but the feature is already included" do
paths = Dir.glob

# dup, add a specific test
dup_path = paths.last + ":22"
paths << dup_path

inspector.send(:included_in_other_path?, dup_path, paths).should be_true
end
end
end
39 changes: 0 additions & 39 deletions spec/guard/cucumber/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,6 @@
end
end

describe ":binstubs" do
it "runs without Bundler with binstubs option to true and bundler option to false" do
subject.should_receive(:system).with(
"bundle exec bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features"
).and_return(true)
subject.run(["features"], :bundler => false, :binstubs => true)
end
it "runs with Bundler and binstubs with bundler option to true and binstubs option to true" do
subject.should_receive(:system).with(
"bundle exec bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features"
).and_return(true)
subject.run(["features"], :bundler => true, :binstubs => true)
end
it "runs with Bundler and binstubs with bundler option unset and binstubs option to true" do
subject.should_receive(:system).with(
"bundle exec bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features"
).and_return(true)
subject.run(["features"], :binstubs => true)
end
it "runs with Bundler and binstubs with bundler option unset, binstubs option to true and all_after_pass option to true" do
subject.should_receive(:system).with(
"bundle exec bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features"
).and_return(true)
subject.run(["features"], :binstubs => true, :all_after_pass => true)
end
it "runs with Bundler and binstubs with bundler option unset, binstubs option to true and all_on_start option to true" do
subject.should_receive(:system).with(
"bundle exec bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features"
).and_return(true)
subject.run(["features"], :binstubs => true, :all_on_start => true)
end
it "runs with Bundler and binstubs with bundler option unset, binstubs option to true, all_on_start option to true and all_after_pass option to true" do
subject.should_receive(:system).with(
"bundle exec bin/cucumber --require #{ @lib_path.join('guard/cucumber/notification_formatter.rb') } --format Guard::Cucumber::NotificationFormatter --out #{ null_device } --require features features"
).and_return(true)
subject.run(["features"], :binstubs => true, :all_after_pass => true, :all_on_start => true)
end
end

context 'with a :cli option' do
it 'appends the cli arguments when calling cucumber' do
runner.should_receive(:system).with(
Expand Down

0 comments on commit 72a1bba

Please sign in to comment.