Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

77 lines (65 sloc) 2.647 kB

Adds shoulda snippets for use with rspec testing

Changes the scope selector so you can use the snippets in rspec tests

Shoulda TextMate bundle

The Shoulda gem makes it easy to write elegant, understandable, and maintainable Ruby tests.

To install with Git:

mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/shaliko/shoulda-tmbundle.git "Shoulda.tmbundle"

To install without Git:

mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
wget http://github.com/shaliko/shoulda-tmbundle/tarball/master
tar zxf shaliko-shoulda-tmbundle*.tar.gz
rm shaliko-shoulda-tmbundle*.tar.gz
mv shaliko-shoulda-tmbundle* "Shoulda.tmbundle"

Snippets

  • Shoulda::ActionController::Matchers

    • should assign_to (sat)

    • should_not assign_to (snat)

    • should filter_params (sfp)

    • should redirect_to (srt)

    • should render_template (srt)

    • should render_with_layout (srwl)

    • should_not render_with_layout (snrwl)

    • should respond_with (srw)

    • should respond_with_content_type (srwct)

    • should route (sr)

    • should set_session (sss)

    • should_not set_session (snss)

    • should set_the_flash_to (sstft)

    • should_not set_the_flash (snsft)

  • Shoulda::ActionMailer::Matchers

    • should have_sent_email (shse)

  • Shoulda::ActiveRecord::Macros

    • should allow_mass_assignment_of (same)

    • should not_allow_mass_assignment_of (snama)

    • should allow_values_for (savf)

    • should not_allow_values_for (snavf)

    • should belong_to (sbt)

    • should have_many (shm)

    • should have_one (sho)

    • should have_and_belong_to_many (shabtm)

    • should ensure_inclusion_of (sei)

    • should ensure_length_of (sel)

    • should have_db_column (shdc)

    • should_not have_db_column (snhdc)

    • should have_db_index (shdi)

    • should have_readonly_attributes (shra)

    • should validate_acceptance_of (svao)

    • should validate_format_of (svf)

    • should validate_numericality_of (svno)

    • should validate_presence_of (svpo)

    • should validate_uniqueness_of (svuo)

  • Shoulda::Context::FastContext

    • fast_context (fcontext)

  • Factory

    • Factory (fac)

    • Factory.define (facd)

    • Factory.next (facn)

    • Factory.sequence (facs)

Credits

Shoulda.tmbundle is maintained by Shalva Usubov, and is funded by Hashtrain, LLC.

License

Shoulda.tmbundle is Copyright © 2010 Shalva Usubov, Hashtrain. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.

Jump to Line
Something went wrong with that request. Please try again.