Features:

  • Nested Contexts
  • Custom matchers are no-brainers with def_matcher()
  • Fast
  • 100% Ruby 1.9 and 1.8 compatible
  • Rails out of the box!
  • Sophisticated Expectations/Matchers System
  • < 300 LOC (sans rdoc)
  • Near Future: Rails Generators, TM-Bundle

Install Speccify:

sudo gem install speccify

Using Speccify

Create a testfile:

        
# test_object.rb  

       require "rubygems"  
       require "speccify"  

       describe Object do  
         before do  
           @obj = Object.new  
         end 

         it "is not nil" do
           @obj.should_not be_nil
         end

         it "can be frozen" do
           @obj.freeze
           @obj.should be_frozen
         end
       end
							

Run it with the ruby command:

$ ruby test_object.rb
Loaded suite -
Started
..
Finished in 0.001820 seconds.

2 tests, 2 assertions, 0 failures, 0 errors

Using Speccify with autotest

  1. Name your testfiles test_whatever.rb
  2. Start autotest
  3. There is no step three …

Contribution

License

(The MIT License)

Copyright (c) Matthias Hennemeyer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.