Class: Tester

Inherits:
Object
  • Object
show all
Defined in:
lib/sfb_scripts/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.



25
26
27
# File 'lib/sfb_scripts/tester.rb', line 25

def initialize(env)
  @env = env
end

Instance Attribute Details

#envObject

Returns the value of attribute env.



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

def env
  @env
end

Class Method Details

.find(inputs, options) ⇒ Object



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

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

.needsObject



5
6
7
# File 'lib/sfb_scripts/tester.rb', line 5

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

.status(options) ⇒ Object



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

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

.status_check(options) ⇒ Object



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

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



29
30
31
32
33
34
35
36
37
# File 'lib/sfb_scripts/tester.rb', line 29

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



39
40
41
# File 'lib/sfb_scripts/tester.rb', line 39

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

#status_check(options) ⇒ Object



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

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