Class: SauceTest::Runner::Options
- Inherits:
-
Object
- Object
- SauceTest::Runner::Options
- Defined in:
- lib/sauce-test/runner/options.rb
Instance Attribute Summary collapse
-
#example ⇒ Object
readonly
Returns the value of attribute example.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#report_file ⇒ Object
readonly
Returns the value of attribute report_file.
-
#sauce_options ⇒ Object
readonly
Returns the value of attribute sauce_options.
-
#test_file ⇒ Object
readonly
Returns the value of attribute test_file.
-
#test_type ⇒ Object
readonly
Returns the value of attribute test_type.
Instance Method Summary collapse
-
#initialize(opt_array = ARGV) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(opt_array = ARGV) ⇒ Options
Returns a new instance of Options.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/sauce-test/runner/options.rb', line 18 def initialize(opt_array = ARGV) @browser = {} @opt_parser = OptionParser.new @opt_parser. = "Usage: sauce_test [options] FILE" @opt_parser.on(*OPTIONS[:list]) {|list| @list = true} @opt_parser.on(*OPTIONS[:type]) {|type| parse_type type} @opt_parser.on(*OPTIONS[:example]) {|example| @example = example} @opt_parser.on(*OPTIONS[:report]) {|report| @report_file = File. report} @opt_parser.on(*OPTIONS[:browser]) {|browser| @browser['name'] = browser} @opt_parser.on(*OPTIONS[:version]) {|version| @browser['version'] = version} @opt_parser.on(*OPTIONS[:os]) {|os| @browser['os'] = os} @opt_parser.on(*OPTIONS[:config]) {|config| parse_config(config)} @opt_parser.on(*OPTIONS[:help]) {show_help} @opt_parser.separator EXAMPLES opt_rest = @opt_parser.parse(opt_array) unless list parse_test_file(opt_rest[0]) end |
Instance Attribute Details
#example ⇒ Object (readonly)
Returns the value of attribute example.
11 12 13 |
# File 'lib/sauce-test/runner/options.rb', line 11 def example @example end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
11 12 13 |
# File 'lib/sauce-test/runner/options.rb', line 11 def list @list end |
#report_file ⇒ Object (readonly)
Returns the value of attribute report_file.
11 12 13 |
# File 'lib/sauce-test/runner/options.rb', line 11 def report_file @report_file end |
#sauce_options ⇒ Object (readonly)
Returns the value of attribute sauce_options.
11 12 13 |
# File 'lib/sauce-test/runner/options.rb', line 11 def @sauce_options end |
#test_file ⇒ Object (readonly)
Returns the value of attribute test_file.
11 12 13 |
# File 'lib/sauce-test/runner/options.rb', line 11 def test_file @test_file end |
#test_type ⇒ Object (readonly)
Returns the value of attribute test_type.
11 12 13 |
# File 'lib/sauce-test/runner/options.rb', line 11 def test_type @test_type end |