Skip to content

Commit 1f74a21

Browse files
authored
Merge pull request #20 from pamil/renaming
Rename to ExcludeSpecificationsExtension
2 parents d64c293 + d4f7e0b commit 1f74a21

File tree

8 files changed

+39
-43
lines changed

8 files changed

+39
-43
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Skip Extension [![License](https://img.shields.io/packagist/l/friends-of-behat/skip-extension.svg)](https://packagist.org/packages/friends-of-behat/skip-extension) [![Version](https://img.shields.io/packagist/v/friends-of-behat/skip-extension.svg)](https://packagist.org/packages/friends-of-behat/skip-extension) [![Build status on Linux](https://img.shields.io/travis/FriendsOfBehat/SkipExtension/master.svg)](http://travis-ci.org/FriendsOfBehat/SkipExtension) [![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/FriendsOfBehat/SkipExtension.svg)](https://scrutinizer-ci.com/g/FriendsOfBehat/SkipExtension/)
1+
# Exclude Specifications Extension [![License](https://img.shields.io/packagist/l/friends-of-behat/exclude-specifications-extension.svg)](https://packagist.org/packages/friends-of-behat/exclude-specifications-extension) [![Version](https://img.shields.io/packagist/v/friends-of-behat/exclude-specifications-extension.svg)](https://packagist.org/packages/friends-of-behat/exclude-specifications-extension) [![Build status on Linux](https://img.shields.io/travis/FriendsOfBehat/ExcludeSpecificationsExtension/master.svg)](http://travis-ci.org/FriendsOfBehat/ExcludeSpecificationsExtension) [![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/FriendsOfBehat/ExcludeSpecificationsExtension.svg)](https://scrutinizer-ci.com/g/FriendsOfBehat/ExcludeSpecificationsExtension/)
22

3-
Allows to skip features and scenarios in Behat tests.
3+
Allows to exclude features or scenarios in Behat tests.
44

55
## Usage
66

77
1. Install it:
88

99
```bash
10-
$ composer require friends-of-behat/skip-extension --dev
10+
$ composer require friends-of-behat/exclude-specifications-extension --dev
1111
```
1212

13-
2. Enable it in your Behat configuration and list features that needs to be skipped:
13+
2. Enable it in your Behat configuration and list features that needs to be excluded:
1414

1515
```yaml
1616
# behat.yml
1717
default:
1818
# ...
1919
extensions:
20-
SkipExtension:
20+
FriendsOfBehat\ExcludeSpecificationsExtension:
2121
features:
2222
- vendor/library/features/feature_to_be_skipped.feature
2323
- vendor/library/features/another_feature_to_be_skipped.feature
2424
```
2525

26-
3. That's it! :tada: Listed features are going to be skipped while executing Behat tests.
26+
3. That's it! :tada: Listed features are going to be excluded while executing Behat tests.

composer.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "friends-of-behat/skip-extension",
3-
"description": "Allows to skip features and scenarios in Behat tests.",
2+
"name": "friends-of-behat/exclude-specifications-extension",
3+
"description": "Allows to exclude features or scenarios in Behat tests.",
44
"license": "MIT",
55
"authors": [
66
{
@@ -16,14 +16,12 @@
1616
},
1717
"require-dev": {
1818
"friends-of-behat/test-context": "^1.0",
19-
"phpspec/phpspec": "^4.0@alpha",
20-
21-
"doctrine/instantiator": "^1.0.5"
19+
"phpspec/phpspec": "^4.0@alpha"
2220
},
2321
"autoload": {
24-
"psr-4": { "FriendsOfBehat\\SkipExtension\\": "src/" }
22+
"psr-4": { "FriendsOfBehat\\ExcludeSpecificationsExtension\\": "src/" }
2523
},
2624
"autoload-dev": {
27-
"psr-4" : { "spec\\FriendsOfBehat\\SkipExtension\\": "spec/" }
25+
"psr-4" : { "spec\\FriendsOfBehat\\ExcludeSpecificationsExtension\\": "spec/" }
2826
}
2927
}

features/skipping_single_feature_file.feature renamed to features/excluding_single_feature_file.feature

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
Feature: Skipping single feature file
22
In order to not run Behat feature which I don't want to be executed
33
As a Behat User
4-
I want to skip specific files
4+
I want to exclude specific files
55

6-
Background:
6+
Scenario: Excluded features are not execuded
77
Given a Behat configuration containing:
88
"""
99
default:
1010
extensions:
11-
FriendsOfBehat\SkipExtension:
11+
FriendsOfBehat\ExcludeSpecificationsExtension:
1212
features:
13-
- "features/skip.feature"
13+
- "features/excluded.feature"
1414
"""
1515
And a context file "features/bootstrap/FeatureContext.php" containing:
1616
"""
@@ -28,22 +28,20 @@ Feature: Skipping single feature file
2828
}
2929
}
3030
"""
31-
And a feature file "features/skip.feature" containing:
31+
And a feature file "features/excluded.feature" containing:
3232
"""
33-
Feature: Feature to skip
33+
Feature: Feature to exclude
3434
3535
Scenario: Doing nothing
3636
When I do nothing
3737
"""
38-
And a feature file "features/run.feature" containing:
38+
And a feature file "features/not_excluded.feature" containing:
3939
"""
40-
Feature: Feature to run
40+
Feature: Feature not to exclude
4141
4242
Scenario: Doing nothing
4343
When I do nothing
4444
"""
45-
46-
Scenario: Seeing proper number of passed scenarios
4745
When I run Behat
4846
Then it should pass with:
4947
"""

phpspec.yml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
suites:
22
main:
3-
namespace: FriendsOfBehat\SkipExtension
4-
psr4_prefix: FriendsOfBehat\SkipExtension
3+
namespace: FriendsOfBehat\ExcludeSpecificationsExtension
4+
psr4_prefix: FriendsOfBehat\ExcludeSpecificationsExtension

spec/Locator/SkipAwareSpecificationIteratorSpec.php renamed to spec/Locator/ExcludingSpecificationIteratorSpec.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
declare(strict_types=1);
44

55
/*
6-
* This file is part of the SkipExtension package.
6+
* This file is part of the ExcludeSpecificationsExtension package.
77
*
88
* (c) Kamil Kokot <kamil@kokot.me>
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.
1212
*/
1313

14-
namespace spec\FriendsOfBehat\SkipExtension\Locator;
14+
namespace spec\FriendsOfBehat\ExcludeSpecificationsExtension\Locator;
1515

1616
use Behat\Testwork\Specification\SpecificationIterator;
1717
use PhpSpec\ObjectBehavior;
1818

19-
final class SkipAwareSpecificationIteratorSpec extends ObjectBehavior
19+
final class ExcludingSpecificationIteratorSpec extends ObjectBehavior
2020
{
2121
function let(SpecificationIterator $specificationIterator): void
2222
{

src/Locator/SkipAwareSpecificationIterator.php renamed to src/Locator/ExcludingSpecificationIterator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
declare(strict_types=1);
44

55
/*
6-
* This file is part of the SkipExtension package.
6+
* This file is part of the ExcludeSpecificationsExtension package.
77
*
88
* (c) Kamil Kokot <kamil@kokot.me>
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.
1212
*/
1313

14-
namespace FriendsOfBehat\SkipExtension\Locator;
14+
namespace FriendsOfBehat\ExcludeSpecificationsExtension\Locator;
1515

1616
use Behat\Testwork\Specification\SpecificationIterator;
1717
use Behat\Testwork\Suite\Suite;
1818

1919
/**
2020
* @internal
2121
*/
22-
final class SkipAwareSpecificationIterator extends \FilterIterator implements SpecificationIterator
22+
final class ExcludingSpecificationIterator extends \FilterIterator implements SpecificationIterator
2323
{
2424
/**
2525
* @var SpecificationIterator

src/Locator/SkipAwareSpecificationLocator.php renamed to src/Locator/ExcludingSpecificationLocator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
declare(strict_types=1);
44

55
/*
6-
* This file is part of the SkipExtension package.
6+
* This file is part of the ExcludeSpecificationsExtension package.
77
*
88
* (c) Kamil Kokot <kamil@kokot.me>
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.
1212
*/
1313

14-
namespace FriendsOfBehat\SkipExtension\Locator;
14+
namespace FriendsOfBehat\ExcludeSpecificationsExtension\Locator;
1515

1616
use Behat\Testwork\Specification\Locator\SpecificationLocator;
1717
use Behat\Testwork\Specification\SpecificationIterator;
@@ -20,7 +20,7 @@
2020
/**
2121
* @internal
2222
*/
23-
final class SkipAwareSpecificationLocator implements SpecificationLocator
23+
final class ExcludingSpecificationLocator implements SpecificationLocator
2424
{
2525
/**
2626
* @var SpecificationLocator
@@ -55,7 +55,7 @@ public function getLocatorExamples(): array
5555
*/
5656
public function locateSpecifications(Suite $suite, $locator): SpecificationIterator
5757
{
58-
return new SkipAwareSpecificationIterator(
58+
return new ExcludingSpecificationIterator(
5959
$this->specificationLocator->locateSpecifications($suite, $locator),
6060
$this->skippedPaths
6161
);

src/ServiceContainer/SkipExtension.php renamed to src/ServiceContainer/ExcludeSpecificationsExtension.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
declare(strict_types=1);
44

55
/*
6-
* This file is part of the SkipExtension package.
6+
* This file is part of the ExcludeSpecificationsExtension package.
77
*
88
* (c) Kamil Kokot <kamil@kokot.me>
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.
1212
*/
1313

14-
namespace FriendsOfBehat\SkipExtension\ServiceContainer;
14+
namespace FriendsOfBehat\ExcludeSpecificationsExtension\ServiceContainer;
1515

1616
use Behat\Testwork\ServiceContainer\Extension;
1717
use Behat\Testwork\ServiceContainer\ExtensionManager;
18-
use FriendsOfBehat\SkipExtension\Locator\SkipAwareSpecificationLocator;
18+
use FriendsOfBehat\ExcludeSpecificationsExtension\Locator\ExcludingSpecificationLocator;
1919
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
2020
use Symfony\Component\DependencyInjection\ContainerBuilder;
2121
use Symfony\Component\DependencyInjection\Definition;
2222
use Symfony\Component\DependencyInjection\Reference;
2323

24-
final class SkipExtension implements Extension
24+
final class ExcludeSpecificationsExtension implements Extension
2525
{
2626
/**
2727
* {@inheritdoc}
2828
*/
2929
public function getConfigKey(): string
3030
{
31-
return 'fob_skip';
31+
return 'fob_exclude_specifications';
3232
}
3333

3434
/**
@@ -58,15 +58,15 @@ public function configure(ArrayNodeDefinition $builder): void
5858
*/
5959
public function load(ContainerBuilder $container, array $config): void
6060
{
61-
$definition = new Definition(SkipAwareSpecificationLocator::class, [
62-
new Reference('specifications.locator.filesystem_feature.skip_aware.inner'),
61+
$definition = new Definition(ExcludingSpecificationLocator::class, [
62+
new Reference('specifications.locator.filesystem_feature.excluding.inner'),
6363
$this->getAbsoluteSkippedPaths($config['features'], $container->getParameter('paths.base'))
6464
]);
6565

6666
$definition->setDecoratedService('specifications.locator.filesystem_feature');
6767
$definition->setPublic(false);
6868

69-
$container->setDefinition('specifications.locator.filesystem_feature.skip_aware', $definition);
69+
$container->setDefinition('specifications.locator.filesystem_feature.excluding', $definition);
7070
}
7171

7272
/**

0 commit comments

Comments
 (0)