Class: Rubidium::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/rubidium/test_suite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ TestSuite

Returns a new instance of TestSuite.



6
7
8
9
10
11
12
13
14
# File 'lib/rubidium/test_suite.rb', line 6

def initialize(path)
  @path            = path
  @test_cases      = []
  x                = Nokogiri::HTML(File.read(path))
  @title           = x.xpath('//title').text
  return false unless x.search('html').attribute 'xmlns' # filter out test reports
  @test_case_paths = x.xpath('//table/tbody/tr/td/a').map {|a| test_case_path a.attributes['href'].text }
  @test_cases      = @test_case_paths.map { |p| Rubidium::TestCase.new(p) }
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/rubidium/test_suite.rb', line 3

def path
  @path
end

#test_case_pathsObject (readonly)

Returns the value of attribute test_case_paths.



3
4
5
# File 'lib/rubidium/test_suite.rb', line 3

def test_case_paths
  @test_case_paths
end

#test_casesObject (readonly)

Returns the value of attribute test_cases.



3
4
5
# File 'lib/rubidium/test_suite.rb', line 3

def test_cases
  @test_cases
end

#titleObject (readonly) Also known as: name

Returns the value of attribute title.



3
4
5
# File 'lib/rubidium/test_suite.rb', line 3

def title
  @title
end