Class: Tester

Inherits:
Object
  • Object
show all
Defined in:
lib/tester.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Tester

Returns a new instance of Tester.



29
30
31
# File 'lib/tester.rb', line 29

def initialize(env)
  @env = env
end

Instance Attribute Details

#envObject

Returns the value of attribute env.



28
29
30
# File 'lib/tester.rb', line 28

def env
  @env
end

Class Method Details

.find(inputs, options) ⇒ Object



13
14
15
16
# File 'lib/tester.rb', line 13

def self.find(inputs, options)
  env = NeedsManager.configure(:test_runner, needs, options.merge(repo_type: :info))
  new(env).find(inputs)
end

.needsObject



9
10
11
# File 'lib/tester.rb', line 9

def self.needs
  [:shell, :repo, :test_runner]
end

.status(options) ⇒ Object



18
19
20
21
# File 'lib/tester.rb', line 18

def self.status(options)
  env = NeedsManager.configure(:test_runner, needs, options.merge(repo_type: :info))
  new(env).status(options)
end

.status_check(options) ⇒ Object



23
24
25
26
# File 'lib/tester.rb', line 23

def self.status_check(options)
  env = NeedsManager.configure(:test_runner, (needs - [:test_runner]), options.merge(repo_type: :info))
  new(env).status_check(options)
end

Instance Method Details

#find(inputs) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/tester.rb', line 33

def find(inputs)
  # each of these replaces this process if successful
  # so no need for logic control flow
  if query_might_be_method?(inputs)
    TestMethodRunner.run(inputs.first, env)
  end
  TestFileRunner.find(inputs, env)
  env[:shell].warn "Giving up :("
end

#status(options) ⇒ Object



43
44
45
# File 'lib/tester.rb', line 43

def status(options)
  TestFileRunner.status(env, options[:no_selenium])
end

#status_check(options) ⇒ Object



47
48
49
# File 'lib/tester.rb', line 47

def status_check(options)
  StatusChecker.report(env, options[:confirm_exit_status])
end