Skip to content

Commit fdc7bd7

Browse files
authored
Merge pull request #11 from recoilphp/focus-spec-1
Add "focus spec" DSL functions.
2 parents 11c5384 + 6339497 commit fdc7bd7

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

src/Peridot/dsl.php

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function describe($description, callable $fn)
2626
*/
2727
function context($description, callable $fn)
2828
{
29-
$fn = Plugin::wrap($fn);
3029
describe($description, $fn);
3130
}
3231

@@ -80,6 +79,41 @@ function xit($description, callable $fn = null)
8079
Context::getInstance()->addTest($description, $fn, true);
8180
}
8281

82+
/**
83+
* Create a focused suite.
84+
*
85+
* @param $description
86+
* @param callable $fn
87+
*/
88+
function fdescribe($description, callable $fn)
89+
{
90+
$fn = Plugin::wrap($fn);
91+
Context::getInstance()->addSuite($description, $fn, null, true);
92+
}
93+
94+
/**
95+
* Create a focused context.
96+
*
97+
* @param $description
98+
* @param callable $fn
99+
*/
100+
function fcontext($description, callable $fn)
101+
{
102+
fdescribe($description, $fn);
103+
}
104+
105+
/**
106+
* Create a focused spec.
107+
*
108+
* @param $description
109+
* @param callable $fn
110+
*/
111+
function fit($description, callable $fn = null)
112+
{
113+
$fn = Plugin::wrap($fn);
114+
Context::getInstance()->addTest($description, $fn, null, true);
115+
}
116+
83117
/**
84118
* Add a setup function for all specs in the
85119
* current suite.

0 commit comments

Comments
 (0)