Class: HTMLRender::RenderTest::DirectoryResult

Inherits:
Result
  • Object
show all
Defined in:
lib/html_render/render_test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Result

#details, #pass?

Constructor Details

#initialize(path, valid_path, canonical_path) ⇒ DirectoryResult

Returns a new instance of DirectoryResult.



76
77
78
79
80
# File 'lib/html_render/render_test.rb', line 76

def initialize(path, valid_path, canonical_path)
  @path = path
  @valid_path = valid_path
  @canonical_path = canonical_path
end

Instance Attribute Details

#canonical_pathObject (readonly)

Returns the value of attribute canonical_path.



74
75
76
# File 'lib/html_render/render_test.rb', line 74

def canonical_path
  @canonical_path
end

#pathObject (readonly)

Returns the value of attribute path.



72
73
74
# File 'lib/html_render/render_test.rb', line 72

def path
  @path
end

#valid_pathObject (readonly)

Returns the value of attribute valid_path.



73
74
75
# File 'lib/html_render/render_test.rb', line 73

def valid_path
  @valid_path
end

Instance Method Details

#details_for(server) ⇒ Object



86
87
88
89
90
91
92
93
# File 'lib/html_render/render_test.rb', line 86

def details_for(server)
  @details_for ||= {}
  @details_for[server] ||= ServerResult.new(
    server,
    filename_of_expected_png_for(server),
    filename_of_actual_png_for(server)
  )
end

#serversObject



82
83
84
# File 'lib/html_render/render_test.rb', line 82

def servers
  @servers ||= Dir.glob(File.join(path, '*.png')).collect{ |s| s.split(/\//).last[0..-5] }.sort
end