Files | Admin

Notes:

Release Name: 0.6.3

Notes:
= Tryouts - v0.6 BETA

Tryouts is a high-level testing library for your command-line applications and Ruby codes.

NOTE: The DSL syntax has changed significantly from 0.5 and command-line app tests are currently disabled. 

== Syntax

Tryouts is a bit different than other testing libraries. Test definitions are organized in a similar way as Shoulda tests (although the keywords in the syntax are different). 

=== Terminology

* Tryout: a set of drills (just like basketball tryouts is a set of drills)
* Drill: a single test. 
* Dream: the expected outcome of a drill. There's always one or more dream per drill. 

== Testing Ruby codes (an API)

Tryouts employs the same approach for testing Ruby codes. The return value of the drill block is compared to the expectation defined by the dream. Here is an example of including dreams inside the tryout definition. 

    library :caesars, "../path/to/caesars/lib"

    tryout "Common Usage" do
      dream 3
      drill "Check the return value" do
        12 / 4
      end
        
      dream :Proc, :class
      drill "Check the return value class" do
        Proc.new do
          :anything
        end
      end
      
      dream NameError, :exception
      drill "A test can pass based on the exception" do
        raise NameError
      end
      
      dream /\w\d\w \d\w\d/, :match
      drill "Knows where Santa Claus lives", 'H0H 0H0'
    end


== BETA Notice

This library is very new (est. 2009-05-19) and has not been vetted by the scrutiny of time. In particular you can expect:

* The test definition syntax may change in future releases. 
* Unexpected errors. 


== On Threads

Tryouts does some funky stuff to make it simple to write tests. This "funky stuff" means that this library is *not thread-safe at definition-time*. However, once all tryouts files are parsed (or in OO-syntax, once all objects are created), this class should be *thread-safe at drill-time*. 

== More Info

* Check out the sourcecodes[http://github.com/delano/tryouts]
* Read the rdocs[http://tryouts.rubyforge.org/]
* About Solutious[http://solutious.com/about/]

== Thanks

* Everyone at Utrecht.rb and Amsterdam.rb

== Credits

* Delano (@solutious.com)

== Related Projects

* Context[http://github.com/jeremymcanally/context/tree/master]
* Testy[http://github.com/ahoward/testy/tree/master]
* Expectations[http://expectations.rubyforge.org/]
* Zebra[http://github.com/giraffesoft/zebra/tree/master]

== License

See: LICENSE.txt


Changes: TRYOUTS, CHANGES #### 0.6.3 (2009-06-25) ############################### NOTE: command testing (:cli) is still disabled. * FIXED: Now correctly append to existing Tryouts object * CHANGE: Renamed :regex format to :match * ADDED: Hella better runtime error handling * ADDED: Better support for quiet (-q) * ADDED: Verbose output now displays each dream vs reality * ADDED: Skipped drills now appear in the report * ADDED: new dream format: :ne (!=) #### 0.6.2 (2009-06-24) ############################### NOTE: command testing (:cli) is still disabled. * CHANGE: dream arguments are now ordered: format, output * ADDED: One-liner drill syntax * ADDED: new dream formats: :regex, :gt, :gte, :lt, :lte, :size * ADDED: Calls to xdrill now also clear the dream catcher * ADDED: Support for multiple dreams per drill #### 0.6.1 (2009-06-24) ############################### NOTE: command testing (:cli) is still disabled. * FIXED: JRuby is now supported * FIXED: Now correctly requiring sysinfo library * CHANGE: Don't require rye until a CLI sergeant is created. #### 0.6.0 (2009-06-24) ############################### NOTE: External dreams files are no longer supported. NOTE: command testing (:cli) is disabled. * CHANGE: Removed all mention of external dreams files. * CHANGE: dream method is not available inside drill block. * CHANGE: rcode, emsg, backtrace renamed to ecode, error, trace * ADDED: dream is now available above drill blocks. * ADDED: Better verbose and debugging output * ADDED: Cleaner test output * ADDED: drill success is now solely based on output. #### 0.5.1 (2009-06-13) ############################### * ADDED: dream method is now available inside drill block * ADDED: Drills that return true are assumed to pass #### 0.5.0 (2009-06-07) ############################### * FIXED: Fix for running drills without dreams and for specifying verbose without a command name * CHANGE: The executable has been renamed to 'sergeant' * CHANGE: Gave reality a default rcode (0) * CHANGE: Now using module_eval (was: class_eval) for setup and clean * ADDED: Displays percentage of failed dreams * ADDED: Drill stash! * ADDED: xdream and better handling for drills and dreams with no name #### 0.4.1 (2009-06-07) ############################### * CHANGE: The CLI output is no longer terrifyingly ugly #### 0.4.0 (2009-06-05) ############################### NOTE: Initial public release