Module: GemSuit::CLI::Application::InstanceMethods

Defined in:
lib/gem_suit/cli/application.rb

Instance Method Summary collapse

Instance Method Details

#test_all(file_or_pattern = nil) ⇒ Object



13
14
15
16
17
18
# File 'lib/gem_suit/cli/application.rb', line 13

def test_all(file_or_pattern = nil)
  test_unit
  test_functional
  test_integration
  test_suit
end

#test_functional(file_or_pattern = nil) ⇒ Object



24
25
26
# File 'lib/gem_suit/cli/application.rb', line 24

def test_functional(file_or_pattern = nil)
  run_tests :functional, file_or_pattern
end

#test_integration(file_or_pattern = nil) ⇒ Object



28
29
30
# File 'lib/gem_suit/cli/application.rb', line 28

def test_integration(file_or_pattern = nil)
  run_tests :integration, file_or_pattern
end

#test_suit(file_or_pattern = nil) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/gem_suit/cli/application.rb', line 32

def test_suit(file_or_pattern = nil)
  assert_suit_dir

  data = IOBuffer.capture do |buffer|
    (options.rails_versions || major_rails_versions).each do |rails_version|
      path  = "suit/rails-#{rails_version}/dummy/test/integration/suit/"
      match = Dir[File.join(path, "**", "#{file_or_pattern || "*"}.rb")]
      match = Dir[File.join(path, file_or_pattern)] if match.empty?

      match.each do |f|
        buffer.execute "ruby #{f} #{"-v" if options.very_verbose?}"
      end
    end
  end

  print_test_results "Suit", data
end

#test_unit(file_or_pattern = nil) ⇒ Object



20
21
22
# File 'lib/gem_suit/cli/application.rb', line 20

def test_unit(file_or_pattern = nil)
  run_tests :unit, file_or_pattern
end