Skip to content

Commit

Permalink
Release 0.7.2 (NOTE: dream argument order has been changed)
Browse files Browse the repository at this point in the history
  • Loading branch information
delano committed Jun 26, 2009
1 parent ed5880c commit ebd30ca
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
53 changes: 51 additions & 2 deletions README.rdoc
Expand Up @@ -11,13 +11,23 @@ A tryout is made up of one of more drills. The return value of the drill block i
* Drill Sergeant: The class responsible for executing a drill.
* Dream: the expected outcome of a drill. There's always one or more dream per drill.


== Installation

$ gem install tryouts


== Examples
== NOTICE (2009-06-26): DSL Syntax Change

The order of dream arguments has reversed between 0.7.1 and 0.7.2. It is now:

* <tt>dream :method, 'Expected value'</tt>

This is a return to the original syntax and I think it's the right way to go because it reads more naturally:

* <tt>drill 'test name', 'return value', :class, String</tt>


== Writing Tests

The examples below are a complete overview of Tryouts syntax.

Expand Down Expand Up @@ -87,6 +97,45 @@ You can also use Tryouts to run benchmarks. The tryouts method takes a second pa

The drill blocks in a benchmark Tryout return Tryouts::Stats objects. See: Tryouts::Drill::Sergeant::Benchmark

== Running Tests

Tryouts comes with an executable called <tt>sergeant</tt>. This is the drill sergeant that tells you what percentage of your dreams come true.

$ sergeant

Gibbler Gazette

Basic syntax with SHA1
"Object" PASS
"Class" PASS
...
"Knows when an Hash has changed" PASS

All 9 dreams came true


The sergeant looks in the current working directory for a <tt>tryouts</tt> directory and will automatically load all files ending in <tt>_tryouts.rb</tt>.

$ ls -l tryouts/
01_mixins_tryouts.rb
10_syntax_tryouts.rb
20_cli_tryouts.rb
30_benchmark_tryouts.rb
50_class_context_tryouts.rb

You can also specify specific files to load:

$ sergeant any/file.rb

Verbose mode gives you some extra information, including the return values from the drills. The more v's, the more information:

$ sergeant -v

In quiet mode, the sergeant returns only a PASS or FAIL message (in the case of a FAIL, it will also return a non-zero exit code):

$ sergeant -q
PASS

== Screenshots

Here is an example of Tryouts output from a gibbler[http://github.com/delano/gibbler/blob/gibbler-0.2.1/tryouts/gibbler_tryouts.rb] tryout:
Expand Down
2 changes: 1 addition & 1 deletion lib/tryouts.rb
Expand Up @@ -41,7 +41,7 @@ def message
end
end

VERSION = "0.7.1"
VERSION = "0.7.2"

require 'tryouts/mixins'
require 'tryouts/tryout'
Expand Down
2 changes: 1 addition & 1 deletion tryouts.gemspec
@@ -1,7 +1,7 @@
@spec = Gem::Specification.new do |s|
s.name = "tryouts"
s.rubyforge_project = "tryouts"
s.version = "0.7.1"
s.version = "0.7.2"
s.summary = "Tryouts are high-level tests for your Ruby code. May all your dreams come true!"
s.description = s.summary
s.author = "Delano Mandelbaum"
Expand Down

0 comments on commit ebd30ca

Please sign in to comment.