Skip to content

Commit

Permalink
reorg cuke features
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Dec 20, 2010
1 parent 8310b17 commit ea4dd96
Show file tree
Hide file tree
Showing 25 changed files with 65 additions and 14 deletions.
27 changes: 27 additions & 0 deletions features/.nav
@@ -0,0 +1,27 @@
- customized_message.feature
- diffing.feature
- implicit_docstrings.feature
- built_in_matchers:
- be.feature
- be_within.feature
- equality.feature
- exist.feature
- expect_change.feature
- expect_error.feature
- have.feature
- include.feature
- match.feature
- operators.feature
- predicates.feature
- respond_to.feature
- satisfy.feature
- throw_symbol.feature
- types.feature
- custom_matchers:
- define_matcher.feature
- define_diffable_matcher.feature
- define_matcher_with_fluent_interface.feature
- access_running_example.feature
- define_matcher_outside_rspec.feature
- test_frameworks:
- test_unit.feature
28 changes: 26 additions & 2 deletions features/README.markdown
@@ -1,12 +1,36 @@
rspec-expectations is used to set expectations in executable rspec-expectations is used to set expectations in executable examples.
examples:


describe Account do describe Account do
it "has a balance of zero when first created" do it "has a balance of zero when first created" do
Account.new.balance.should eq(Money.new(0)) Account.new.balance.should eq(Money.new(0))
end end
end end


## should and should_not

rspec-expectations adds `should` and `should_not` to every object. Each of
these can accept a matcher and, in most cases, an optional custom failure
message (see [customized
message](/rspec/rspec-expectations/v/2-3/customized-message)).

## Matchers

A Matcher is any object that responds to the following methods:

matches?(actual)
failure_message_for_should

These methods are also part of the matcher protocol, but are optional:

does_not_match?(actual)
failure_message_for_should_not
description

RSpec ships with a number of [built-in
matchers](/rspec/rspec-expectations/v/2-3/dir/built-in-matchers) and a DSL for
writing your own [custom
matchers](/rspec/rspec-expectations/v/2-3/dir/custom-matchers).

## Issues ## Issues


The documentation for rspec-expectations is a work in progress. We'll be adding The documentation for rspec-expectations is a work in progress. We'll be adding
Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
Feature: Equality matchers Feature: equality matchers


Ruby exposes several different methods for handling equality: Ruby exposes several different methods for handling equality:


Expand Down
File renamed without changes.
@@ -1,4 +1,4 @@
Feature: Expect change Feature: expect change


Expect some code (wrapped in a proc) to change the state of some object. Expect some code (wrapped in a proc) to change the state of some object.


Expand Down
@@ -1,4 +1,4 @@
Feature: Expect error Feature: expect error


Expect a proc to raise an error when called. Expect a proc to raise an error when called.


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
Feature: Operator matchers Feature: operator matchers


RSpec provides a number of matchers that are based on Ruby's built-in RSpec provides a number of matchers that are based on Ruby's built-in
operators. These pretty much work like you expect. For example, each of these operators. These pretty much work like you expect. For example, each of these
Expand Down
@@ -1,4 +1,4 @@
Feature: Predicate matchers Feature: predicate matchers


Ruby objects commonly provide predicate methods: Ruby objects commonly provide predicate methods:


Expand Down
File renamed without changes.
@@ -1,4 +1,4 @@
Feature: Satisfy matcher Feature: satisfy matcher


The satisfy matcher is extremely flexible and can handle almost anything The satisfy matcher is extremely flexible and can handle almost anything
you want to specify. It passes if the block you provide returns true: you want to specify. It passes if the block you provide returns true:
Expand Down
@@ -1,4 +1,4 @@
Feature: Throw symbol matcher Feature: throw_symbol matcher


The throw_symbol matcher is used to specify that a block of code The throw_symbol matcher is used to specify that a block of code
throws a symbol. The most basic form passes if any symbol is thrown: throws a symbol. The most basic form passes if any symbol is thrown:
Expand Down
File renamed without changes.
@@ -1,4 +1,4 @@
Feature: Access running example Feature: access running example


In order to take advantage of services that are available In order to take advantage of services that are available
in my examples when I'm writing matchers in my examples when I'm writing matchers
Expand Down
@@ -1,4 +1,4 @@
Feature: Define diffable matcher Feature: define diffable matcher


When a matcher is defined as diffable, and the --diff When a matcher is defined as diffable, and the --diff
flag is set, the output will include a diff of the submitted flag is set, the output will include a diff of the submitted
Expand Down
@@ -1,4 +1,4 @@
Feature: Define matcher Feature: define matcher


In order to express my domain clearly in my code examples In order to express my domain clearly in my code examples
As an RSpec user As an RSpec user
Expand Down
@@ -1,4 +1,4 @@
Feature: Define matcher outside rspec Feature: define matcher outside rspec


In order to express my domain clearly in my code examples In order to express my domain clearly in my code examples
As a non-rspec user As a non-rspec user
Expand Down
@@ -1,4 +1,4 @@
Feature: Define matcher with fluent interface Feature: define matcher with fluent interface


Use the chain() method to define matchers with a fluent interface. Use the chain() method to define matchers with a fluent interface.


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ea4dd96

Please sign in to comment.