Permalink
Browse files

Refactoring

  • Loading branch information...
1 parent ca2f14e commit 7c62052b46c84971681144f9c4d8a281fde57364 @thibaudgg thibaudgg committed Mar 1, 2011
Showing with 19 additions and 13 deletions.
  1. +19 −13 lib/guard/rspec/runner.rb
View
@@ -17,19 +17,7 @@ def set_rspec_version(options={})
private
def rspec_command(paths, options={})
- rspec_exec = case rspec_version
- when 1
- "Spec"
- when 2
- "RSpec"
- end
-
- [:color, :drb, :fail_fast, [:formatter, "format"]].each do |option|
- key, value = option.is_a?(Array) ? option : [option, option.to_s.gsub('_', '-')]
- if options.key?(key)
- UI.info %{DEPRECATION WARNING: The :#{key} option is deprecated. Pass standard command line argument "--#{value}" to RSpec with the :cli option.}
- end
- end
+ warn_deprectation(options)
cmd_parts = []
cmd_parts << "rvm #{options[:rvm].join(',')} exec" if options[:rvm].is_a?(Array)
@@ -60,6 +48,24 @@ def determine_rspec_version
end
end
+ def rspec_exec
+ case rspec_version
+ when 1
+ "Spec"
+ when 2
+ "RSpec"
+ end
+ end
+
+ def warn_deprectation(options={})
+ [:color, :drb, :fail_fast, [:formatter, "format"]].each do |option|
+ key, value = option.is_a?(Array) ? option : [option, option.to_s.gsub('_', '-')]
+ if options.key?(key)
+ UI.info %{DEPRECATION WARNING: The :#{key} option is deprecated. Pass standard command line argument "--#{value}" to RSpec with the :cli option.}
+ end
+ end
+ end
+
end
end
end

0 comments on commit 7c62052

Please sign in to comment.