module Shoulda::ClassMethods

def before_should(name, &blk)

end
end
end
end
User.expects(:find).with(:all).returns(@users)
before_should "find all users" do
# runs before "get :index"

should_respond_with :success

setup { get :index }
context "on GET" do

end
User.stubs(:find).returns(@users)
@users = [Factory(:user)]
setup do
context "the index action" do
class UserControllerTest < Test::Unit::TestCase

=== Example:

context's setup. These are especially useful when setting expectations.
Before statements are should statements that run before the current

== Before statements
def before_should(name, &blk)
  should(name, :before => blk) { assert true }
end

def context(name, &blk)

def context(name, &blk)
  if Shoulda.current_context
    Shoulda.current_context.context(name, &blk)
  else
    context = Shoulda::Context.new(name, self, &blk)
    context.build
  end
end

def described_type

# => User
class UserTest; described_type; end

Returns the class being tested, as determined by the test class name.
def described_type
  self.name.gsub(/Test$/, '').constantize
end

def should(name, options = {}, &blk)

def should(name, options = {}, &blk)
  if Shoulda.current_context
    block_given? ? Shoulda.current_context.should(name, options, &blk) : Shoulda.current_context.should_eventually(name)
  else
    context_name = self.name.gsub(/Test/, "")
    context = Shoulda::Context.new(context_name, self) do
      block_given? ? should(name, options, &blk) : should_eventually(name)
    end
    context.build
  end
end

def should_eventually(name, options = {}, &blk)

Just like should, but never runs, and instead prints an 'X' in the Test::Unit output.
def should_eventually(name, options = {}, &blk)
  context_name = self.name.gsub(/Test/, "")
  context = Shoulda::Context.new(context_name, self) do
    should_eventually(name, &blk)
  end
  context.build
end

def subject(&block)

end
should_validate_uniqueness_of :email
# uses the existing user

subject { User.first }
class UserTest < Test::Unit::TestCase

Sets the return value of the subject instance method:
def subject(&block)
  @subject_block = block
end

def subject_block # :nodoc:

:nodoc:
def subject_block # :nodoc:
  @subject_block
end