Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove RSpec 1.x support

- some cleaning too
  • Loading branch information...
commit 31e1be02503c51ed37aeda486866550f7f8395d2 1 parent 49fef65
Thibaud Guillaume-Gentil authored
View
35 Gemfile
@@ -1,9 +1,36 @@
-source "http://rubygems.org"
+source :rubygems
gemspec
gem 'rake'
-gem 'ruby_gntp'
-platforms :ruby do
- gem 'rb-readline'
+gem 'listen', :github => 'guard/listen'
+
+# The development group will no be
+# installed on Travis CI.
+#
+group :development do
+
+ platform :ruby_19 do
+ gem 'coolline'
+ end
+
+ require 'rbconfig'
+
+ if RbConfig::CONFIG['target_os'] =~ /darwin/i
+ gem 'growl', :require => false
+ gem 'rb-fsevent', :require => false
+
+ if `uname`.strip == 'Darwin' && `sw_vers -productVersion`.strip >= '10.8'
+ gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
+ end rescue Errno::ENOENT
+
+ elsif RbConfig::CONFIG['target_os'] =~ /linux/i
+ gem 'libnotify', '~> 0.7.1', :require => false
+ gem 'rb-inotify', :require => false
+
+ elsif RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
+ gem 'win32console', :require => false
+ gem 'rb-notifu', '>= 0.0.4', :require => false
+ gem 'wdm', :require => false
+ end
end
View
2  Guardfile
@@ -1,4 +1,4 @@
-guard 'rspec', :version => 2 do
+guard 'rspec' do
watch(%r{^spec/.+_spec\.rb})
watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
View
11 README.md
@@ -2,7 +2,7 @@
RSpec guard allows to automatically & intelligently launch specs when files are modified.
-* Compatible with RSpec 1.x & RSpec 2.x (>= 2.4 needed for the notification feature).
+* Compatible with RSpec >= 2.11 (use guard-rspec 1.2.x for older release, including RSpec 1.x)
* Tested against Ruby 1.8.7, 1.9.2, 1.9.3, REE and the latest versions of JRuby & Rubinius.
## Install
@@ -66,14 +66,6 @@ Please read [Guard doc](https://github.com/guard/guard#readme) for more informat
## Options
-By default, Guard::RSpec automatically detect your RSpec version (with the `spec_helper.rb` syntax or with Bundler) but you can force the version with the `:version` option:
-
-``` ruby
-guard 'rspec', :version => 2 do
- # ...
-end
-```
-
You can pass any of the standard RSpec CLI options using the `:cli` option:
``` ruby
@@ -116,7 +108,6 @@ Former `:color`, `:drb`, `:fail_fast` and `:formatter` options are deprecated an
### List of available options:
``` ruby
-:version => 1 # force use RSpec version 1, default: 2
:cli => "-c -f doc" # pass arbitrary RSpec CLI arguments, default: "-f progress"
:bundler => false # use "bundle exec" to run the RSpec command, default: true
:binstubs => true # use "bin/rspec" to run the RSpec command (takes precedence over :bundle), default: false
View
2  guard-rspec.gemspec
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.add_dependency 'guard', '>= 1.1'
s.add_dependency 'rspec', '~> 2.11'
- s.add_development_dependency 'bundler', '~> 1.0'
+ s.add_development_dependency 'bundler', '~> 1.2'
s.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.md]
s.require_path = 'lib'
View
2  lib/guard/rspec.rb
@@ -24,7 +24,7 @@ def initialize(watchers = [], options = {})
# Call once when guard starts
def start
- UI.info "Guard::RSpec is running, with RSpec #{@runner.rspec_version}!"
+ UI.info "Guard::RSpec is running"
run_all if @options[:all_on_start]
end
View
9 lib/guard/rspec/formatter.rb
@@ -1,7 +1,14 @@
require "#{File.dirname(__FILE__)}/../rspec"
require 'guard/notifier'
+require "rspec/core/formatters/base_formatter"
-module Guard::RSpec::Formatter
+class Guard::RSpec::Formatter < RSpec::Core::Formatters::BaseFormatter
+
+ def dump_summary(duration, total, failures, pending)
+ message = guard_message(total, failures, pending, duration)
+ image = guard_image(failures, pending)
+ notify(message, image)
+ end
def guard_message(example_count, failure_count, pending_count, duration)
message = "#{example_count} examples, #{failure_count} failures"
View
13 lib/guard/rspec/formatters/notification_rspec.rb
@@ -1,13 +0,0 @@
-require "#{File.dirname(__FILE__)}/../formatter"
-require "rspec/core/formatters/base_formatter"
-
-class Guard::RSpec::Formatter::NotificationRSpec < RSpec::Core::Formatters::BaseFormatter
- include Guard::RSpec::Formatter
-
- def dump_summary(duration, total, failures, pending)
- message = guard_message(total, failures, pending, duration)
- image = guard_image(failures, pending)
- notify(message, image)
- end
-
-end
View
13 lib/guard/rspec/formatters/notification_spec.rb
@@ -1,13 +0,0 @@
-require "#{File.dirname(__FILE__)}/../formatter"
-require "spec/runner/formatter/base_formatter"
-
-class Guard::RSpec::Formatter::NotificationSpec < Spec::Runner::Formatter::BaseFormatter
- include Guard::RSpec::Formatter
-
- def dump_summary(duration, total, failures, pending)
- message = guard_message(total, failures, pending, duration)
- image = guard_image(failures, pending)
- notify(message, image)
- end
-
-end
View
73 lib/guard/rspec/runner.rb
@@ -4,7 +4,6 @@
module Guard
class RSpec
class Runner
- attr_reader :rspec_version
FAILURE_EXIT_CODE = 2
@@ -37,15 +36,8 @@ def run(paths, options = {})
end
end
- def rspec_version
- @rspec_version ||= @options[:version] || determine_rspec_version
- end
-
def rspec_executable
- @rspec_executable ||= begin
- exec = rspec_class.downcase
- binstubs? ? "#{binstubs}/#{exec}" : exec
- end
+ @rspec_executable ||= binstubs? ? "#{binstubs}/rspec" : "rspec"
end
def failure_exit_code_supported?
@@ -58,15 +50,6 @@ def failure_exit_code_supported?
end
end
- def rspec_class
- @rspec_class ||= case rspec_version
- when 1
- "Spec"
- when 2
- "RSpec"
- end
- end
-
def parsed_or_default_formatter
@parsed_or_default_formatter ||= begin
# Use RSpec's parser to parse formatters
@@ -91,8 +74,8 @@ def rspec_arguments(paths, options)
arg_parts << options[:cli]
if @options[:notification]
arg_parts << parsed_or_default_formatter unless options[:cli] =~ formatter_regex
- arg_parts << "-r #{File.dirname(__FILE__)}/formatters/notification_#{rspec_class.downcase}.rb"
- arg_parts << "-f Guard::RSpec::Formatter::Notification#{rspec_class}#{rspec_version == 1 ? ":" : " --out "}/dev/null"
+ arg_parts << "-r #{File.dirname(__FILE__)}/formatter.rb"
+ arg_parts << "-f Guard::RSpec::Formatter --out /dev/null"
end
arg_parts << "--failure-exit-code #{FAILURE_EXIT_CODE}" if failure_exit_code_supported?
arg_parts << "-r turnip/rspec" if @options[:turnip]
@@ -145,20 +128,15 @@ def run_via_drb(paths, options)
end
def drb_used?
- if @drb_used.nil?
- @drb_used = @options[:cli] && @options[:cli].include?('--drb')
- else
- @drb_used
- end
+ @drb_used ||= @options[:cli] && @options[:cli].include?('--drb')
end
- # RSpec 1 & 2 use the same DRb call signature, and we can avoid loading a large chunk of rspec
+ # W we can avoid loading a large chunk of rspec
# just to let DRb know what to do.
#
# For reference:
#
- # * RSpec 1: https://github.com/myronmarston/rspec-1/blob/master/lib/spec/runner/drb_command_line.rb
- # * RSpec 2: https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/drb_command_line.rb
+ # * RSpec: https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/drb_command_line.rb
def drb_service(port)
require "drb/drb"
@@ -178,52 +156,25 @@ def drb_service(port)
end
def bundler_allowed?
- if @bundler_allowed.nil?
- @bundler_allowed = File.exist?("#{Dir.pwd}/Gemfile")
- else
- @bundler_allowed
- end
+ @bundler_allowed ||= File.exist?("#{Dir.pwd}/Gemfile")
end
def bundler?
- if @bundler.nil?
- @bundler = bundler_allowed? && @options[:bundler]
- else
- @bundler
- end
+ @bundler ||= bundler_allowed? && @options[:bundler]
end
def binstubs?
- if @binstubs.nil?
- @binstubs = !!@options[:binstubs]
- else
- @binstubs
- end
+ @binstubs ||= !!@options[:binstubs]
end
def binstubs
- if @options[:binstubs] == true
- "bin"
- else
- @options[:binstubs]
- end
+ @options[:binstubs] == true ? "bin" : @options[:binstubs]
end
def bundle_exec?
bundler? && !binstubs?
end
- def determine_rspec_version
- if File.exist?("#{Dir.pwd}/spec/spec_helper.rb")
- File.new("#{Dir.pwd}/spec/spec_helper.rb").read.include?("Spec::Runner") ? 1 : 2
- elsif bundler_allowed?
- ENV['BUNDLE_GEMFILE'] = "#{Dir.pwd}/Gemfile"
- `bundle show rspec`.include?("/rspec-1.") ? 1 : 2
- else
- 2
- end
- end
-
def deprecations_warnings
[:color, :drb, [:fail_fast, "fail-fast"], [:formatter, "format"]].each do |option|
key, value = option.is_a?(Array) ? option : [option, option.to_s]
@@ -232,6 +183,10 @@ def deprecations_warnings
UI.info %{DEPRECATION WARNING: The :#{key} option is deprecated. Pass standard command line argument "--#{value}" to RSpec with the :cli option.}
end
end
+ if @options.key?(:version)
+ @options.delete(:version)
+ UI.info %{DEPRECATION WARNING: The :version option is deprecated. Only RSpec 2 is now supported.}
+ end
end
def formatter_regex
View
6 lib/guard/rspec/templates/Guardfile
@@ -1,4 +1,4 @@
-guard 'rspec', :version => 2 do
+guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
@@ -10,10 +10,10 @@ guard 'rspec', :version => 2 do
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
-
+
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
-
+
# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
View
3  spec/fixtures/bundler_only_rspec1/Gemfile
@@ -1,3 +0,0 @@
-source "http://rubygems.org"
-
-gem "rspec", "~> 1.3.1"
View
11 spec/fixtures/bundler_only_rspec1/Gemfile.lock
@@ -1,11 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- rspec (1.3.1)
-
-PLATFORMS
- java
- ruby
-
-DEPENDENCIES
- rspec (~> 1.3.1)
View
5 spec/fixtures/rspec1/Gemfile
@@ -1,5 +0,0 @@
-source "http://rubygems.org"
-
-gem "rspec", "~> 1.3.1"
-gem "guard"
-gem "guard-rspec"
View
26 spec/fixtures/rspec1/Gemfile.lock
@@ -1,26 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- configuration (1.2.0)
- guard (0.3.0)
- open_gem (~> 1.4.2)
- thor (~> 0.14.6)
- guard-rspec (0.1.9)
- guard (>= 0.2.2)
- launchy (0.3.7)
- configuration (>= 0.0.5)
- rake (>= 0.8.1)
- open_gem (1.4.2)
- launchy (~> 0.3.5)
- rake (0.8.7)
- rspec (1.3.1)
- thor (0.14.6)
-
-PLATFORMS
- java
- ruby
-
-DEPENDENCIES
- guard
- guard-rspec
- rspec (~> 1.3.1)
View
5 spec/fixtures/rspec1/Guardfile
@@ -1,5 +0,0 @@
-guard 'rspec', :version => 1 do
- watch(%r{^spec/.+_spec\.rb})
- watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
- watch('spec/spec_helper.rb') { "spec" }
-end
View
9 spec/fixtures/rspec1/spec/foo_spec.rb
@@ -1,9 +0,0 @@
-require 'spec_helper'
-
-describe "Foo" do
-
- it "should be true" do
- true.should be_true
- end
-
-end
View
5 spec/fixtures/rspec1/spec/spec_helper.rb
@@ -1,5 +0,0 @@
-require 'rubygems'
-require 'spec'
-
-Spec::Runner.configure do |config|
-end
View
2  spec/guard/rspec/formatter_spec.rb
@@ -1,7 +1,7 @@
require "#{File.dirname(__FILE__)}/../../../lib/guard/rspec/formatter"
describe Guard::RSpec::Formatter do
- subject { Class.new { include Guard::RSpec::Formatter }.new }
+ subject { Guard::RSpec::Formatter.new(StringIO.new) }
describe '#guard_message' do
context 'with a pending example' do
View
144 spec/guard/rspec/runner_spec.rb
@@ -8,9 +8,6 @@
end
describe '.initialize' do
- it 'sets rspec_version' do
- described_class.new.rspec_version.should_not be_nil
- end
describe 'shows warnings for deprecated options' do
[:color, :drb, [:fail_fast, 'fail-fast'], [:formatter, 'format']].each do |option|
@@ -40,8 +37,8 @@
it 'runs with RSpec 2 and without bundler' do
subject.should_receive(:system).with(
- "rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -55,8 +52,8 @@
it 'runs with RSpec 2 and with Bundler' do
subject.should_receive(:system).with(
- "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -85,19 +82,6 @@
service_double
}
- context 'RSpec 1' do
- it 'returns false when RSpec fails to execute' do
- service.should_receive(:run) { false }
-
- subject.run(['spec']).should be_false
- end
- it 'returns true when RSpec succeeds to execute' do
- service.should_receive(:run) { true }
-
- subject.run(['spec']).should be_true
- end
- end
-
context 'RSpec 2' do
it 'returns false when RSpec fails to execute' do
service.should_receive(:run) { 1 }
@@ -167,8 +151,8 @@
it 'runs with rvm exec' do
subject.should_receive(:system).with(
'bundle exec rspec --format doc ' <<
- "-r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "-r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'], :cli => '--format doc')
@@ -193,8 +177,8 @@
it 'runs with rvm exec' do
subject.should_receive(:system).with(
'rvm 1.8.7,1.9.2 exec bundle exec rspec -f progress ' <<
- "-r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "-r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -209,8 +193,8 @@
it 'runs with CLI options passed to RSpec' do
subject.should_receive(:system).with(
'bundle exec rspec --color --drb --fail-fast -f progress ' <<
- "-r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "-r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -219,8 +203,8 @@
it 'use progress formatter by default' do
subject.should_receive(:system).with(
- "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -231,8 +215,8 @@
it 'respects formatter passed in CLI options to RSpec' do
subject.should_receive(:system).with(
- "bundle exec rspec -f doc -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bundle exec rspec -f doc -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -244,8 +228,8 @@
it 'respects formatter passed in CLI options to RSpec' do
subject.should_receive(:system).with(
- "bundle exec rspec -fdoc -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bundle exec rspec -fdoc -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -257,8 +241,8 @@
it 'respects formatter passed in CLI options to RSpec' do
subject.should_receive(:system).with(
- "bundle exec rspec --format doc -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bundle exec rspec --format doc -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -270,8 +254,8 @@
it 'respects formatter passed in CLI options to RSpec' do
subject.should_receive(:system).with(
- "bundle exec rspec --format=doc -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bundle exec rspec --format=doc -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -285,8 +269,8 @@
it 'runs without Bundler' do
subject.should_receive(:system).with(
- "rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -300,8 +284,8 @@
it 'runs without Bundler and with binstubs' do
subject.should_receive(:system).with(
- "bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -313,8 +297,8 @@
it 'runs without Bundler and binstubs' do
subject.should_receive(:system).with(
- "bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "bin/rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -326,8 +310,8 @@
it 'runs without Bundler and binstubs in custom directory' do
subject.should_receive(:system).with(
- "dir/rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "dir/rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -362,8 +346,8 @@
it 'runs with Turnip support enabled' do
subject.should_receive(:system).with(
- "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 -r turnip/rspec spec'
+ "bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 -r turnip/rspec spec'
).and_return(true)
subject.run(['spec'])
@@ -377,8 +361,8 @@
it 'sets the Rails environment' do
subject.should_receive(:system).with(
- "export RAILS_ENV=blue; bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_rspec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec'
+ "export RAILS_ENV=blue; bundle exec rspec -f progress -r #{@lib_path.join('guard/rspec/formatter.rb')} " <<
+ '-f Guard::RSpec::Formatter --out /dev/null --failure-exit-code 2 spec'
).and_return(true)
subject.run(['spec'])
@@ -387,68 +371,6 @@
end
end
end
-
- context 'in RSpec 1 folder with Bundler' do
- before do
- Dir.stub(:pwd).and_return(@fixture_path.join('rspec1'))
- described_class.any_instance.stub(:failure_exit_code_supported? => false)
- end
-
- it 'runs with RSpec 1 and with bundler' do
- subject.should_receive(:system).with(
- "bundle exec spec -f progress -r #{@lib_path.join('guard/rspec/formatters/notification_spec.rb')} " <<
- '-f Guard::RSpec::Formatter::NotificationSpec:/dev/null spec'
- ).and_return(true)
-
- subject.run(['spec'])
- end
- end
- end
-
- describe '#rspec_version' do
- it ':version option sets the @rspec_version' do
- described_class.new(:version => 1).rspec_version.should be 1
- end
-
- context 'in empty folder' do
- before { Dir.stub(:pwd).and_return(@fixture_path.join('empty')) }
-
- it 'sets RSpec 2 because cannot determine version' do
- subject.rspec_version.should be 2
- end
- end
-
- context 'in RSpec 1 folder with Bundler' do
- before { Dir.stub(:pwd).and_return(@fixture_path.join('bundler_only_rspec1')) }
-
- it 'sets RSpec 1 from Bundler' do
- subject.rspec_version.should be 1
- end
- end
-
- context 'in RSpec 2 folder with Bundler' do
- before { Dir.stub(:pwd).and_return(@fixture_path.join('bundler_only_rspec2')) }
-
- it 'sets RSpec 2 from Bundler' do
- subject.rspec_version.should be 2
- end
- end
-
- context 'in RSpec 1 folder without Bundler' do
- before { Dir.stub(:pwd).and_return(@fixture_path.join('rspec1')) }
-
- it 'sets RSpec 1 from spec_helper.rb' do
- subject.rspec_version.should be 1
- end
- end
-
- context 'in RSpec 2 folder without Bundler' do
- before { Dir.stub(:pwd).and_return(@fixture_path.join('rspec2')) }
-
- it 'sets RSpec 2 from spec_helper.rb' do
- subject.rspec_version.should be 2
- end
- end
end
describe '#parsed_or_default_formatter' do
@@ -510,7 +432,7 @@ def stub_options_file(method, value)
it 'returns the output files for the specified formatters' do
formatters.should include('-f html -o doc/specs.html',
'-f documentation -o doc/specs.txt')
- formatters.should_not include('-f progress -o')
+ formatters.should_not include('-f progress -o')
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.