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(input) ⇒ Object



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

def find(input)
  tests = TestFinder.find(input, env)

  env[:test_runner].run(tests)
  env[:shell].warn "Giving up :("
end

#status(options) ⇒ Object



36
37
38
# File 'lib/sfb_scripts/tester.rb', line 36

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

#status_check(options) ⇒ Object



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

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