Class: Rubidium::TestSuite
- Inherits:
-
Object
- Object
- Rubidium::TestSuite
- Defined in:
- lib/rubidium/test_suite.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#test_case_paths ⇒ Object
readonly
Returns the value of attribute test_case_paths.
-
#test_cases ⇒ Object
readonly
Returns the value of attribute test_cases.
-
#title ⇒ Object
(also: #name)
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(path) ⇒ TestSuite
constructor
A new instance of TestSuite.
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
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/rubidium/test_suite.rb', line 3 def path @path end |
#test_case_paths ⇒ Object (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_cases ⇒ Object (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 |
#title ⇒ Object (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 |