Class: Fat::ReferenceFixture

Inherits:
Fit::ColumnFixture show all
Defined in:
lib/fat/reference_fixture.rb

Constant Summary

Constants inherited from Fit::Fixture

Fit::Fixture::GRAY, Fit::Fixture::GREEN, Fit::Fixture::RED, Fit::Fixture::YELLOW

Instance Attribute Summary collapse

Attributes inherited from Fit::Fixture

#args, #counts, #listener, #summary

Instance Method Summary collapse

Methods inherited from Fit::ColumnFixture

#check, #do_cell, #do_row, #do_rows, #execute, #reset

Methods inherited from Fit::Fixture

camel, #check, #do_cell, #do_cells, #do_row, #do_rows, #do_table, #do_tables, #error, escape, #exception, #find_class, #fixture_name, #get_args_for_table, #get_linked_fixture_with_args, gray, #ignore, #info, #initialize, #interpret_following_tables, #interpret_tables, label, metadata, #parse, #right, #total_errors, #totals, #wrong

Constructor Details

This class inherits a constructor from Fit::Fixture

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#locationObject

Returns the value of attribute location.



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

def location
  @location
end

Instance Method Details

#resultObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fat/reference_fixture.rb', line 10

def result
  input_name = "spec/#@location"
  output_name = "spec/results_#@location"
  begin
    runner = Fit::FileRunner.new
    runner.process_args [input_name, output_name]
    runner.process
    runner.output.close
    
    counts = runner.fixture.counts
    if counts.total_errors.zero?
      return 'pass'
    else
      return "fail: #{counts.to_s}"
    end
  rescue Exception => e
    return "file not found: #{input_name}"
  end
end