Class: Rubotium::TestCasesReader

Inherits:
Object
  • Object
show all
Defined in:
lib/rubotium/test_cases_reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(device, test_package, options = {}) ⇒ TestCasesReader

Returns a new instance of TestCasesReader.



3
4
5
6
7
# File 'lib/rubotium/test_cases_reader.rb', line 3

def initialize(device, test_package, options = {})
  @device         = device
  @test_package   = test_package
  @annotation     = options.delete(:annotation)
end

Instance Method Details

#create_runnable_test(test) ⇒ Object



16
17
18
# File 'lib/rubotium/test_cases_reader.rb', line 16

def create_runnable_test(test)
  Rubotium::RunnableTest.new(test.class_name, test.test_name)
end

#read_testsObject



9
10
11
12
13
14
# File 'lib/rubotium/test_cases_reader.rb', line 9

def read_tests
  result = device.shell(instrument_command).result
  Rubotium::Adb::Parsers::TestResultsParser.new(result).test_results.map{|test|
    create_runnable_test(test)
  }
end