Class: Selenium::WebDriver::Support::Guards::Guard Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Support::Guards::Guard
- Defined in:
- lib/selenium/webdriver/support/guards/guard.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Guard derived from RSpec example metadata.
Instance Attribute Summary collapse
- #guarded ⇒ Object readonly private
- #messages ⇒ Object readonly private
- #reason ⇒ Object readonly private
- #type ⇒ Object readonly private
Instance Method Summary collapse
-
#except? ⇒ Boolean
private
Bug is present on all configurations specified.
-
#exclude? ⇒ Boolean
private
Bug is present on all configurations specified, but test can not be run because it breaks other tests.
-
#exclusive? ⇒ Boolean
private
Test only applies to configurations specified.
-
#initialize(guarded, type, guards = nil) ⇒ Guard
constructor
private
A new instance of Guard.
- #message ⇒ Object private
-
#only? ⇒ Boolean
private
Bug is present on all configurations not specified.
Constructor Details
#initialize(guarded, type, guards = nil) ⇒ Guard
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Guard.
32 33 34 35 36 37 38 39 40 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 32 def initialize(guarded, type, guards = nil) @guarded = guarded @tracker = guards&.bug_tracker || '' @messages = guards&. || {} @messages[:unknown] = 'TODO: Investigate why this is failing and file a bug report' @type = type @reason = @guarded.delete(:reason) end |
Instance Attribute Details
#guarded ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 30 def guarded @guarded end |
#messages ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 30 def @messages end |
#reason ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 30 def reason @reason end |
#type ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 30 def type @type end |
Instance Method Details
#except? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Bug is present on all configurations specified
65 66 67 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 65 def except? @type == :except end |
#exclude? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Bug is present on all configurations specified, but test can not be run because it breaks other tests
75 76 77 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 75 def exclude? @type == :exclude end |
#exclusive? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test only applies to configurations specified
80 81 82 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 80 def exclusive? @type == :exclusive end |
#message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 42 def details = case @reason when Integer "Bug Filed: #{@tracker}/#{@reason}" when Symbol @messages[@reason] when String @reason else 'no reason given' end case @type when :exclude "Test not guarded because it breaks test run; #{details}" when :exclusive "Test does not apply to this configuration; #{details}" else "Test guarded; #{details}" end end |
#only? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Bug is present on all configurations not specified
70 71 72 |
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 70 def only? @type == :only end |