Sha256: ffa558d4db45d6e3e1ed3a15cf443a9a2d712a3ab2ddaa7c612bb5d03968e05d

Contents?: true

Size: 1.32 KB

Versions: 4

Compression:

Stored size: 1.32 KB

Contents

= MiniShoulda

A minimal shoulda DSL built on top of MiniTest::Spec. MiniTest is the future, and we should all be 
using it! No pun. The MiniShoulda gem is a simple set of alias built on top of MiniTest so that we can use 
basic shoulda syntax. A simple example says it all.

  class MyTestClass < MiniTest::Spec

    setup do
      @object = Object.new
    end

    teardown do
      @object.freeze
    end

    should 'find object' do
      assert @object
      refute_instance_of Object, @object
    end

    should_eventually 'works too' do
      refute true, 'will use skip and not run'
    end

    context 'with another context' do

      setup do
        @object = [1,2,3]
      end

      should 'just work' do
        assert_includes @object, 2
      end

    end

  end


= Install

  $ gem install mini_shoulda


= What About ActiveRecord Macros

It is not my goal to implement all the ActiveRecord macros nor things like should_have_db_columns :)


= Any Hacks?

Not really. MiniShoulda is built on top of the existing MiniTest::Spec methods. Basically they are 
just a series of aliases to those methods. Our only monkey patch is in MiniTest's Kernel#describe method 
so you can maintain class scope in your own test cases. Please help me lobby the MiniTest team to get 
that patch in.

* https://github.com/seattlerb/minitest/pull/9

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mini_shoulda-0.5.0 README.rdoc
mini_shoulda-0.4.0 README.rdoc
mini_shoulda-0.3.0 README.rdoc
mini_shoulda-0.2.0 README.rdoc