Module: Lighthouse::Matchers

Defined in:
lib/lighthouse/matchers.rb,
lib/lighthouse/matchers/version.rb

Overview

rubocop:disable Style/Documentation

Defined Under Namespace

Classes: Error

Constant Summary collapse

VERSION =
'1.4.0'

Class Attribute Summary collapse

Class Attribute Details

.chrome_flagsObject



27
28
29
30
31
32
# File 'lib/lighthouse/matchers.rb', line 27

def chrome_flags
  return unless @chrome_flags
  return @chrome_flags unless @chrome_flags.is_a?(Array)

  @chrome_flags.map { |f| "--#{f}" }.join(' ')
end

.form_factorObject

Returns the value of attribute form_factor.



13
14
15
# File 'lib/lighthouse/matchers.rb', line 13

def form_factor
  @form_factor
end

.lighthouse_cliObject



19
20
21
# File 'lib/lighthouse/matchers.rb', line 19

def lighthouse_cli
  @lighthouse_cli ||= guess_lighthouse_cli
end

.minimum_scoreObject



15
16
17
# File 'lib/lighthouse/matchers.rb', line 15

def minimum_score
  @minimum_score ||= default_minimum_score
end

.presetObject

Returns the value of attribute preset.



13
14
15
# File 'lib/lighthouse/matchers.rb', line 13

def preset
  @preset
end

.remote_debugging_portObject

Returns the value of attribute remote_debugging_port.



13
14
15
# File 'lib/lighthouse/matchers.rb', line 13

def remote_debugging_port
  @remote_debugging_port
end

.results_directoryObject



34
35
36
37
38
39
40
# File 'lib/lighthouse/matchers.rb', line 34

def results_directory
  @results_directory ||= if defined?(RSpec)
                           File.join(RSpec.configuration.default_path, 'lighthouse')
                         else
                           Dir.mktmpdir('lighthouse-matchers-')
                         end
end

.runnerObject



23
24
25
# File 'lib/lighthouse/matchers.rb', line 23

def runner
  @runner ||= proc { |cmd| `#{cmd}` }
end