Module: Testify::Framework::ClassMethods
- Defined in:
- lib/framework.rb
Instance Method Summary collapse
-
#file_pattern(pattern) ⇒ Object
Accepts a glob pattern that limits the paths returned by ‘#files`.
-
#statuses(*new_statuses) ⇒ Object
Gets and sets an array of symbols corresponding to the possible TestResult statuses that might be set by this Framework.
Instance Method Details
#file_pattern(pattern) ⇒ Object
Accepts a glob pattern that limits the paths returned by ‘#files`. Only paths with filenames that match this pattern will be returned by .files
.
For example, if all your framework’s test files should end in _mytests.rb, you might do this:
class MyTestFramework
include Testify::Framework
file_pattern '*_mytests.rb'
...
end
110 111 112 |
# File 'lib/framework.rb', line 110 def file_pattern( pattern ) self.class_eval { @file_pattern = pattern } end |
#statuses(*new_statuses) ⇒ Object
Gets and sets an array of symbols corresponding to the possible TestResult statuses that might be set by this Framework.
For example, a framework with tests that can only pass or fail might like like this:
class SomeFramework
include Testify::Framework
statuses :passed, :failed
...
end
SomeFramework.statuses # => [ :passed, :failed ]
88 89 90 91 92 93 |
# File 'lib/framework.rb', line 88 def statuses( *new_statuses ) if new_statuses.any? @statuses = new_statuses end @statuses end |