class SmartTest::SpecRunner

Public Class Methods

new(root, options={}) click to toggle source
# File lib/smart_test/spec_runner.rb, line 6
def initialize(root, options={})
  @project = Project.new root
  @filter = Filter.new @project
  @options = {
    type: :mtime,
    param: 1
  }.merge! options
end

Public Instance Methods

cmd() click to toggle source
# File lib/smart_test/spec_runner.rb, line 23
def cmd
  @cmd ||= "bundle exec rspec #{files.join(' ')}"
end
files() click to toggle source
# File lib/smart_test/spec_runner.rb, line 15
def files
  @files ||= @filter.send @options[:type], @options[:param]
end
run() click to toggle source
# File lib/smart_test/spec_runner.rb, line 19
def run
  system cmd
end