Skip to content

Commit

Permalink
Added more stuff to README
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Aug 6, 2008
1 parent 6bb0f3d commit c8ccf09
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
32 changes: 31 additions & 1 deletion examples/java/README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,34 @@ jruby -S rake features
This will compile the java code and package it in a jar file, and then run Cucumber against
that code.

There is a deliberate error. See if you can fix it!
There is a deliberate error. See if you can fix it!

h2. Background and Credits

Cucumber is a rewrite of RSpec's "Story runner", which was originally written by Dan North. Dan's original
implementation required that stories be written in Ruby. Shortly after, David Chelimsky added
"plain text":http://blog.davidchelimsky.net/articles/2007/10/21/story-runner-in-plain-english support.

This brought executable stories a little closer to non-technical users, which is one of the target audiences
for this kind of tool.

However, the RSpec Story runner has several shortcomings which is rather common for tools that move into new territory.
Some of the biggest problems with it are:

* Hard to get started with. A special "all.rb" file must be written before it can be used.
* No out of the box Rake support, which puts a lot of people off.
* No i18n, so if you want to write stories in a different language than English you're out of luck.
* Poor error reporting. No way to know on what line a plain text story failed during execution or parsing.
* Limited colouring of output.
* No simple way to execute only one scenario.
* No command line tool to run stories.

While all of this could have been fixed in the existing codebase, I figured it would be easier to do a rewrite from scratch.
I also had some ideas for extensions of the story grammar, so I decided to use "Treetop":http://treetop.rubyforge.org/
and base it on a proper "grammar":http://github.com/aslakhellesoy/cucumber/tree/master/lib/cucumber/treetop_parser/feature.treetop.erb

Cucumber addresses all of the shortcomings of RSpec's Story runner. If the community likes it, we'll consider phasing out
the RSpec story runner.

The term "Feature" has been adopted in favour of "Story" because I believe it is a more appropriate term. A feature's scenarios
typically increases over time - fed by several user stories.
2 changes: 1 addition & 1 deletion examples/java/features/hello.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Story: Hello
Feature: Hello
In order to have more friends
I want to say hello

Expand Down
2 changes: 1 addition & 1 deletion examples/java/features/tree.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Story: Tree
Feature: Tree
In order to have more robust Java software
I want to use Cucumber against Java classes

Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/formatters/html_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def visit_feature(feature)
end

def visit_header(header)
@io.puts " <dt>Story: #{header}</dt>"
@io.puts " <dt>Feature: #{header}</dt>"
end

def visit_narrative(narrative)
Expand Down
4 changes: 2 additions & 2 deletions spec/cucumber/formatters/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<body>
<div id="container">
<dl class="feature new">
<dt>Story: Addition
<dt>Feature: Addition
</dt>
<dd>
<p>
Expand All @@ -216,7 +216,7 @@
</dd>
</dl>
<dl class="feature new">
<dt>Story: Division
<dt>Feature: Division
</dt>
<dd>
<p>
Expand Down

0 comments on commit c8ccf09

Please sign in to comment.