Class: Frameworks::RSpec
- Inherits:
-
Object
- Object
- Frameworks::RSpec
- Includes:
- Base
- Defined in:
- lib/soundcheck/frameworks/rspec.rb
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#command(*args) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/soundcheck/frameworks/rspec.rb', line 21 def command(*args) args = (args.empty? ? default_args : filter(*args)) return nil if args.empty? to_run = [] to_run << "bundle exec" if has_gemfile? and requires_spec_helper?(*args) to_run << "rspec" to_run << "-b" if [:trace] to_run << "--format=doc" if args.size < 2 and args != default_args to_run << args.join(" ") to_run.join(" ").strip end |
#default_args ⇒ Object
17 18 19 |
# File 'lib/soundcheck/frameworks/rspec.rb', line 17 def default_args ["spec"] end |
#filter(*args) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/soundcheck/frameworks/rspec.rb', line 9 def filter(*args) filter_with(args, { :is_spec_file => /_spec\.rb$/, :is_in_spec_dir => /^spec/, :is_dir => lambda {|arg| project.has_dir?(arg) } }) end |
#present? ⇒ Boolean
5 6 7 |
# File 'lib/soundcheck/frameworks/rspec.rb', line 5 def present? project.has_file?("spec") end |