Class: Guard::RSpec::Results

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/rspec/results.rb

Defined Under Namespace

Classes: InvalidData

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Results

Returns a new instance of Results.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/guard/rspec/results.rb', line 10

def initialize(filename)
  lines = File.readlines(filename)
  if lines.empty? || lines.first.empty?
    dump = lines.inspect
    raise InvalidData, "Invalid results in: #{filename},"\
      " lines:\n#{dump}\n"
  end

  @summary = lines.first.chomp
  @failed_paths = lines[1..11].map(&:chomp).compact
end

Instance Attribute Details

#failed_pathsObject (readonly)

Returns the value of attribute failed_paths.



8
9
10
# File 'lib/guard/rspec/results.rb', line 8

def failed_paths
  @failed_paths
end

#summaryObject (readonly)

Returns the value of attribute summary.



7
8
9
# File 'lib/guard/rspec/results.rb', line 7

def summary
  @summary
end