Class: Scraptacular::Group
- Inherits:
-
Object
- Object
- Scraptacular::Group
- Defined in:
- lib/scraptacular/group.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#suites ⇒ Object
Returns the value of attribute suites.
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Group
constructor
A new instance of Group.
- #run(out) ⇒ Object
- #suite(name, options = {}, &block) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Group
Returns a new instance of Group.
5 6 7 8 9 10 |
# File 'lib/scraptacular/group.rb', line 5 def initialize(name, &block) @name = name @suites = [] instance_eval(&block) end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/scraptacular/group.rb', line 3 def name @name end |
#suites ⇒ Object
Returns the value of attribute suites.
3 4 5 |
# File 'lib/scraptacular/group.rb', line 3 def suites @suites end |
Instance Method Details
#run(out) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/scraptacular/group.rb', line 12 def run(out) out.puts "Group: #{self.name}" results = {} suites.each do |suite| results[suite.name] = suite.run(out) end results end |
#suite(name, options = {}, &block) ⇒ Object
24 25 26 27 28 |
# File 'lib/scraptacular/group.rb', line 24 def suite(name, = {}, &block) suite = Scraptacular::Suite.new(name, , &block) @suites << suite suite end |