Class: Neo::Rails::Mock::MockConfig
- Inherits:
-
Object
- Object
- Neo::Rails::Mock::MockConfig
- Defined in:
- lib/neo/rails/mock.rb
Instance Method Summary collapse
-
#description ⇒ Object
Returns a human readable tag list.
-
#initialize(tags, options = {}) ⇒ MockConfig
constructor
A new instance of MockConfig.
- #option(name) ⇒ Object
-
#tag(*tags) ⇒ Object
Tag mock with
tags
. -
#tagged?(tag) ⇒ Boolean
Checks if this mock is tagged with
tag
. - #tags ⇒ Object
-
#untag(*tags) ⇒ Object
Untag mock.
Constructor Details
#initialize(tags, options = {}) ⇒ MockConfig
Returns a new instance of MockConfig.
58 59 60 61 |
# File 'lib/neo/rails/mock.rb', line 58 def initialize(, ={}) @tags = Set.new() @options = end |
Instance Method Details
#description ⇒ Object
Returns a human readable tag list.
64 65 66 |
# File 'lib/neo/rails/mock.rb', line 64 def description @tags.map { |tag| tag.to_s.capitalize }.join(", ") end |
#option(name) ⇒ Object
87 88 89 |
# File 'lib/neo/rails/mock.rb', line 87 def option(name) @options[name] end |
#tag(*tags) ⇒ Object
Tag mock with tags
.
73 74 75 |
# File 'lib/neo/rails/mock.rb', line 73 def tag(*) .each { |tag| @tags << tag } end |
#tagged?(tag) ⇒ Boolean
Checks if this mock is tagged with tag
.
83 84 85 |
# File 'lib/neo/rails/mock.rb', line 83 def tagged?(tag) @tags.include?(tag) end |
#tags ⇒ Object
68 69 70 |
# File 'lib/neo/rails/mock.rb', line 68 def @tags.to_a end |
#untag(*tags) ⇒ Object
Untag mock.
78 79 80 |
# File 'lib/neo/rails/mock.rb', line 78 def untag(*) .each { |tag| @tags.delete(tag) } end |