class Object

Public Instance Methods

files_from_args(args) click to toggle source
# File lib/speedyrspec/rake_tasks.rb, line 16
def files_from_args(args)
  (args[:files] || ARGV.drop(1) || []).tap do |files_to_test|
    raise 'Please specify which file needs to be tested' if files_to_test.empty?
  end
end
git_modified_files() click to toggle source
# File lib/speedyrspec/rake_tasks.rb, line 4
def git_modified_files
  status = open('|git status -s').readlines
  status.map(&:strip).flat_map{|s| s.split.drop(1)}.tap do |files|
    raise 'No file was modiffied in your git repository.' if files.empty?
  end
end
set_files_to_run(t, files_to_test) click to toggle source
# File lib/speedyrspec/rake_tasks.rb, line 11
def set_files_to_run(t, files_to_test)
  t.pattern = 'deliberately-left-blank'
  t.rspec_opts = SpeedyRspec::Resolver.new.get_tests(files_to_test)
end
show_files_to_run(files_to_test) click to toggle source
# File lib/speedyrspec/rake_tasks.rb, line 22
def show_files_to_run(files_to_test)
  files = SpeedyRspec::Resolver.new.get_tests(files_to_test)
  puts "Files to run: \n\t#{files.join("\n\t")}"
end