Module: Testdiff

Defined in:
lib/testdiff.rb,
lib/testdiff/rspec.rb,
lib/testdiff/rubocop.rb,
lib/testdiff/version.rb,
lib/testdiff/modified/specs.rb,
lib/testdiff/modified/ruby_files.rb

Overview

The current version of this gem

Defined Under Namespace

Modules: Modified, Rspec, Rubocop

Constant Summary collapse

VERSION =
'1.0.0'.freeze

Class Method Summary collapse

Class Method Details

.run(tests) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/testdiff.rb', line 9

def run(tests)
  if tests.empty?
    run(%w[rubocop rspec])
  else
    tests.each do |test|
      run_test(test)
      puts
    end
  end
end

.run_test(test) ⇒ Object

private



22
23
24
25
26
27
28
29
30
31
# File 'lib/testdiff.rb', line 22

def run_test(test)
  case test.to_s.downcase
  when 'rubocop'
    Rubocop.run
  when 'rspec'
    Rspec.run
  else
    puts "Unknown test: #{test}."
  end
end