Method: Phocus.method_pattern
- Defined in:
-
lib/phocus.rb,
lib/phocus.rb
Specify a pattern that identifies the names of the group of methods focusing will apply to.
For example, when using test/unit, you want the relevant group of methods to be your test methods, which are the ones starting with test_.
Phocus.method_pattern = /^test_/
(which happens to be the default pattern)
On the other hand, context (github.com/jeremymcanally/context), has test methods starting with test:, so you can specify:
Phocus.method_pattern = /^test:/
In reality, it’s not so much that Phocus focuses on certain methods, but rather it ignores others. Since we don’t want to ignore helper methods (setup, teardown, custom helpers, etc.), we must restrict the scope of ignored methods, which is what method_pattern allows us to do.
67 68 69 |
# File 'lib/phocus.rb', line 67 def method_pattern @method_pattern end |