Class: TestRunner::Cli::TagFilters
- Inherits:
-
Object
- Object
- TestRunner::Cli::TagFilters
- Defined in:
- lib/test-runner/cli/tag_filters.rb
Instance Attribute Summary collapse
-
#cant ⇒ Object
readonly
protected
Returns the value of attribute cant.
-
#must ⇒ Object
readonly
protected
Returns the value of attribute must.
Instance Method Summary collapse
-
#initialize(str_tags) ⇒ TagFilters
constructor
A new instance of TagFilters.
- #parse_all(str_tags) ⇒ Object protected
- #pass?(test_script) ⇒ Boolean
Constructor Details
#initialize(str_tags) ⇒ TagFilters
Returns a new instance of TagFilters.
4 5 6 7 8 |
# File 'lib/test-runner/cli/tag_filters.rb', line 4 def initialize() @must = [] @cant = [] parse_all() end |
Instance Attribute Details
#cant ⇒ Object (readonly, protected)
Returns the value of attribute cant.
18 19 20 |
# File 'lib/test-runner/cli/tag_filters.rb', line 18 def cant @cant end |
#must ⇒ Object (readonly, protected)
Returns the value of attribute must.
18 19 20 |
# File 'lib/test-runner/cli/tag_filters.rb', line 18 def must @must end |
Instance Method Details
#parse_all(str_tags) ⇒ Object (protected)
20 21 22 23 24 25 26 27 28 |
# File 'lib/test-runner/cli/tag_filters.rb', line 20 def parse_all() .each do |t| if t.start_with?('^') cant << t[1..] else must << t end end end |
#pass?(test_script) ⇒ Boolean
11 12 13 14 |
# File 'lib/test-runner/cli/tag_filters.rb', line 11 def pass?(test_script) must.all? { |t| test_script..include?(t) } \ && cant.all? { |t| !test_script..include?(t) } end |