Browse files

Improve README

  • Loading branch information...
1 parent b5eecd4 commit c80c84c5347b814d22e55ccd87ab1463fe1e2b7a @narwen committed with Hashrocket Workstation Apr 4, 2012
Showing with 27 additions and 7 deletions.
  1. +27 −7
@@ -4,9 +4,11 @@ A simple interface for the state of objects under test. Useful as an interface a
## Installation
-Add this line to your application's Gemfile:
+Add this line to your application's `Gemfile`:
gem 'statefulton'
And then execute:
@@ -16,7 +18,7 @@ Or install it yourself as:
$ gem install statefulton
-## Usage
+## How does it work
Defined DSL methods:
@@ -26,43 +28,61 @@ Defined DSL methods:
Accessing the state of something:
-* StateOf(:name, "context")
+ StateOf(:name, "context")
Creating a statefulton:
-* Statefulton(:name) { # a block of calls to the DSL methods }
+ Statefulton(:name) { # a block of calls to the DSL methods }
Reset state between tests:
-* Statefulton::Reset.all
+ Statefulton::Reset.all
-To define a new statefulton:
+## Cucumber Usage
+To define a new statefulton on `features/support/statefulton.rb`:
Statefulton(:user) do
builder { }
make "an"
expects "that" # Calling "that" will return the singular instance
StateOf(:user, "that") #raise error: instance not created
StateOf(:user, "an") #build the object
StateOf(:user, "an") #raise error: instance already created
StateOf(:user, "that") #get the object
-Cucumber Usage:
+Define your cucumber feature on `features` or a subdirectory.
Given a user
When I activate that user
+Define your steps on `features/steps`
Transform /^(a|that) user$/ do |state|
StateOf(:user, state)
When /^I activate (that user)$/ do |user|
## Contributing

0 comments on commit c80c84c

Please sign in to comment.