Skip to content

Commit

Permalink
Updated features a little for relish
Browse files Browse the repository at this point in the history
  • Loading branch information
davedevelopment committed Mar 28, 2013
1 parent 33d9d97 commit c4270fb
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 55 deletions.
7 changes: 5 additions & 2 deletions features/command_line/bootstrap.feature
Expand Up @@ -3,9 +3,12 @@ Feature: Execute a php bootstrap file
As a developer
I want to specify a php file for bootstrapping

Scenario: User specifies bootstrap file
Scenario: Specifying a bootstrap file

You can specify a file to be included before running your test suites via the command line switch `-b`.

Given a file named "bootstrap.php" with:
"""
"""php
<?php
echo 'dave';
"""
Expand Down
@@ -1,11 +1,11 @@
Feature: See failure details
Feature: Displaying failures
In order to fix my code
As a developer
I need to see the details of the failed tests

Scenario: See failure exception
Scenario: Display Failure exception messages
Given a file named "FailSpec.php" with:
"""
"""php
<?php
describe("fail1", function() {
Expand All @@ -19,9 +19,9 @@ Feature: See failure details
And the output should contain "will fail2"
And the output should contain "fail1"

Scenario: See failure exception with stack trace in verbose mode
Scenario: Display stack trace in verbose mode
Given a file named "FailSpec.php" with:
"""
"""php
<?php
describe("fail1", function() {
Expand Down
4 changes: 2 additions & 2 deletions features/command_line/formatters.feature
Expand Up @@ -3,7 +3,7 @@ Feature: Specify formatters on the command line
As a developer
I need to specify the formatter

Scenario: Specify one formatter
Scenario: Specify a formatter on the command line
Given a file named "TestSpec.php" with:
"""
<?php
Expand All @@ -18,7 +18,7 @@ Feature: Specify formatters on the command line
And the output should not contain ".."
And the output should not contain "Failures:"

Scenario: Specify two formatters
Scenario: Specify multiple formatters on the command line
Given a file named "TestSpec.php" with:
"""
<?php
Expand Down
4 changes: 2 additions & 2 deletions features/command_line/no_globals.feature
@@ -1,11 +1,11 @@
Feature: Avoid defining the dspec global functions
Feature: Disable defining the dspec global functions
In order to prevent name clashes
As a developer
I need to prevent dspec loading the global functions

Scenario: Globals disabled via env
Given a file named "TestSpec.php" with:
"""
"""php
<?php
use DSpec\DSpec as ds;
Expand Down
32 changes: 16 additions & 16 deletions features/command_line/specs_argument.feature
@@ -1,19 +1,19 @@
Feature: specs argument
Feature: Specifying which specs to run
In order to run the specs I want
As a spec runner
I want to specify which specs to run

Scenario: Default to ./spec
Scenario: Default to *Spec.php within a ./spec directory
Given a file named "spec/TestSpec.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
});
});
"""
And a file named "spec/Test.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
Expand All @@ -24,17 +24,17 @@ Feature: specs argument
When I run `dspec`
Then the output should contain "1 example passed"

Scenario: Pass a directory
Scenario: Specify a directory
Given a file named "spec/TestSpec.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
});
});
"""
And a file named "spec/Test.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
Expand All @@ -46,17 +46,17 @@ Feature: specs argument
Then the output should contain "1 example passed"


Scenario: Pass multiple directories
Scenario: Specifying multiple directories
Given a file named "spec/TestSpec.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
});
});
"""
And a file named "spec2/TestSpec.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
Expand All @@ -67,17 +67,17 @@ Feature: specs argument
When I run `dspec spec spec2`
Then the output should contain "1 of 2 examples failed"

Scenario: Pass a dir and a file
Scenario: Specifying directories and files at the same time
Given a file named "spec/TestSpec.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
});
});
"""
And a file named "spec2/Test.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
Expand All @@ -88,17 +88,17 @@ Feature: specs argument
When I run `dspec spec spec2/Test.php`
Then the output should contain "1 of 2 examples failed"

Scenario: Pass a glob
Scenario: Specifying a glob
Given a file named "spec/IncludeSpec.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
});
});
"""
And a file named "spec/ExcludeSpec.php" with:
"""
"""php
<?php
describe("a thing", function() {
it("does things", function() {
Expand Down
24 changes: 15 additions & 9 deletions features/config/config_file.feature
Expand Up @@ -5,7 +5,7 @@ Feature: Configuration files

Background:
Given a file named "DaveSpec.php" with:
"""
"""php
<?php
describe("config file", function() {
Expand All @@ -14,22 +14,28 @@ Feature: Configuration files
"""

Scenario: User specifies config file
Given a file named "mydspec.yml" with:
"""
Scenario: Using the default config file

By default, dspec will look for a file called `dspec.yml` or `dspec.yml.dist` in the current working directory.

Given a file named "dspec.yml" with:
"""yaml
default:
paths: [ "DaveSpec.php" ]
"""
When I run `dspec -c mydspec.yml`
When I run `dspec`
Then the output should contain "1 example passed"

Scenario: Command find default file
Given a file named "dspec.yml" with:
"""
Scenario: Specifying a config file on the command line

You can use the `-c` switch to specify a config file to use.

Given a file named "mydspec.yml" with:
"""yaml
default:
paths: [ "DaveSpec.php" ]
"""
When I run `dspec`
When I run `dspec -c mydspec.yml`
Then the output should contain "1 example passed"

Scenario: Command can not find specified file
Expand Down
4 changes: 2 additions & 2 deletions features/context/clean_context_per_example.feature
Expand Up @@ -4,9 +4,9 @@ Feature: Clean context per example
I want the execution context to be clean for every example

@php5.4
Scenario: Object is not available in subsequent examples
Scenario: Context is not tainted by previous examples
Given a file named "context.feature" with:
"""
"""php
<?php
describe("top level", function() {
Expand Down
14 changes: 7 additions & 7 deletions features/context/let.feature
@@ -1,11 +1,11 @@
Feature: Factories for context vars
Feature: Use let to define factories for context vars
In order to help my tests be more readable
As a developer
I want the to describe the setup of individual vars

Background:
Given a file named "dspec.yml" with:
"""
"""yaml
default:
extensions:
hamcrest:
Expand All @@ -15,7 +15,7 @@ Feature: Factories for context vars
@php5.4
Scenario: Let var is available on $this
Given a file named "context.feature" with:
"""
"""php
<?php
describe("top level", function() {
Expand All @@ -34,7 +34,7 @@ Feature: Factories for context vars

Scenario: Let var is can be injected by name
Given a file named "context.feature" with:
"""
"""php
<?php
describe("top level", function() {
Expand All @@ -54,7 +54,7 @@ Feature: Factories for context vars
@php5.4
Scenario: Let var is memoized
Given a file named "context.feature" with:
"""
"""php
<?php
describe("top level", function() {
Expand All @@ -74,7 +74,7 @@ Feature: Factories for context vars
@php5.4
Scenario: Let var can use other lets
Given a file named "context.feature" with:
"""
"""php
<?php
describe("top level", function() {
Expand All @@ -99,7 +99,7 @@ Feature: Factories for context vars

Scenario: Let var can use other lets via injection
Given a file named "context.feature" with:
"""
"""php
<?php
describe("top level", function() {
Expand Down
4 changes: 2 additions & 2 deletions features/formatters/spec.feature
Expand Up @@ -3,9 +3,9 @@ Feature: Pretty print specs and results
As a developer
I want to see the titles, context and grouping in the results

Scenario: Shows a passing test
Scenario: Passing tests
Given a file named "TestSpec.php" with:
"""
"""php
<?php
describe("Dog", function() {
Expand Down
16 changes: 8 additions & 8 deletions features/hooks/before_and_after_hooks.feature
@@ -1,12 +1,12 @@
Feature: before and after hooks
Feature: Before and After hooks

Use `before` and `after` hooks to execute arbitrary code before and/or
after the body of an example is run:

@php5.4
Scenario: define beforeEach block
Given a file named "BeforeEachSpec.php" with:
"""
"""php
<?php
class Thing {
Expand Down Expand Up @@ -41,9 +41,9 @@ Feature: before and after hooks
When I run `dspec BeforeEachSpec.php`
Then the output should contain "3 examples passed"

Scenario: before/after blocks are run in order
Scenario: Hooks are run in the order they are defined
Given a file named "BeforeAfterOrderSpec.php" with:
"""
"""php
<?php
describe("before and after callbacks", function() {
beforeEach(function() {
Expand Down Expand Up @@ -77,9 +77,9 @@ Feature: before and after hooks
after one
"""

Scenario: exception in beforeEach is captured and reported as failure
Scenario: An Exception in a beforeEach is captured and reported as failure
Given a file named "ExceptionInBeforeEachSpec.php" with:
"""
"""php
<?php
describe("exception in beforeEach", function() {
beforeEach(function() {
Expand All @@ -95,9 +95,9 @@ Feature: before and after hooks
Then the output should contain "1 of 1 examples failed"


Scenario: exception in afterEach is captured and reported as failure
Scenario: An Exception in a afterEach is captured and reported as failure
Given a file named "ExceptionInAfterEachSpec.php" with:
"""
"""php
<?php
describe("exception in afterEach", function() {
afterEach(function() {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit c4270fb

Please sign in to comment.