Class: Whitestone::Scope

Inherits:
Object show all
Defined in:
lib/whitestone.rb

Overview

A Scope object contains a group of Test objects and the setup and teardown information for that group. A ā€˜Dā€™ method opens a new scope.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScope

Returns a new instance of Scope.



78
79
80
81
82
83
84
# File 'lib/whitestone.rb', line 78

def initialize
  @tests       = []
  @before_each = []
  @after_each  = []
  @before_all  = []
  @after_all   = []
end

Instance Attribute Details

#after_allObject (readonly)

Returns the value of attribute after_all.



77
78
79
# File 'lib/whitestone.rb', line 77

def after_all
  @after_all
end

#after_eachObject (readonly)

Returns the value of attribute after_each.



77
78
79
# File 'lib/whitestone.rb', line 77

def after_each
  @after_each
end

#before_allObject (readonly)

Returns the value of attribute before_all.



77
78
79
# File 'lib/whitestone.rb', line 77

def before_all
  @before_all
end

#before_eachObject (readonly)

Returns the value of attribute before_each.



77
78
79
# File 'lib/whitestone.rb', line 77

def before_each
  @before_each
end

#testsObject (readonly)

Returns the value of attribute tests.



77
78
79
# File 'lib/whitestone.rb', line 77

def tests
  @tests
end

Instance Method Details

#filter(regex) ⇒ Object



85
86
87
# File 'lib/whitestone.rb', line 85

def filter(regex)
  @tests = @tests.select { |t| t.description =~ regex }
end