-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
76 lines (53 loc) · 1.49 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
==== Summary
Phocus let's you temporarily focus some tests, ignoring all others, even across test classes.
==== Install
gem install phocus --source http://gemcutter.org
==== Features
* Ultra simple to use
* Works accross testcase classes
* Works within contexts
* Can focus multiple tests
* Simple code (< 50 LOCs)
* Compatible with various testing frameworks
==== Examples
require 'test/unit'
require 'phocus'
class TestUser < Test::Unit::TestCase
focus
def test_foo
assert User.do_something
end
def test_bar
assert User.do_something_else
end
end
class TestAcmeWidget < Test::Unit::TestCase
def test_abc
assert true
end
focus
def test_xyz
assert true
end
end
Executing these tests (say with +rake test+ or +autotest+), will
only run +test_foo+ and +test_xyz+.
Also works fine with +test "description"+ style tests (or +it+,
or +should+, ...).
focus
test "abc" do
assert true
end
==== Testing Framework Compatibility
Phocus is known to be compatible with the following testing frameworks (see test/compat/*):
* test/unit
* minitest/unit
* shoulda
* context
* contest
It is possibly compatible out of the box with other test/unit-based testing
frameworks as well, but it should be fairly easy to set up if it isn't (include
Phocus in parent testcase class and set proper method_pattern. See rdocs)
==== Links
source:: http://github.com/mynyml/phocus
rdocs:: http://docs.github.com/mynyml/phocus