shoulda-3.5.0/0000755000004100000410000000000012142363146013210 5ustar www-datawww-datashoulda-3.5.0/shoulda.gemspec0000644000004100000410000000237612142363146016224 0ustar www-datawww-data$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib') require 'shoulda/version' Gem::Specification.new do |s| s.name = 'shoulda' s.version = Shoulda::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Tammer Saleh", "Joe Ferris", "Ryan McGeary", "Dan Croak", "Matt Jankowski"] s.email = %q{support@thoughtbot.com} s.homepage = %q{https://github.com/thoughtbot/shoulda} s.summary = %q{Making tests easy on the fingers and eyes} s.description = %q{Making tests easy on the fingers and eyes} s.license = %q{MIT} s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.add_dependency("shoulda-context", ["~> 1.0", ">= 1.0.1"]) s.add_dependency("shoulda-matchers", [">= 1.4.1", "< 3.0"]) s.add_development_dependency('appraisal', '~> 0.4.0') s.add_development_dependency("rails", "3.0.12") s.add_development_dependency("sqlite3", "~> 1.3.2") s.add_development_dependency("rspec-rails", "~> 2.7.0") s.add_development_dependency("cucumber", "~> 1.1.0") s.add_development_dependency("aruba", "~> 0.4.11") end shoulda-3.5.0/MIT-LICENSE0000644000004100000410000000212012142363146014637 0ustar www-datawww-dataCopyright (c) 2006-2013 Tammer Saleh and thoughtbot, inc. 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. shoulda-3.5.0/.travis.yml0000644000004100000410000000011612142363146015317 0ustar www-datawww-datarvm: - 1.8.7 - 1.9.3 - 2.0.0 matrix: allow_failures: - rvm: 1.8.7shoulda-3.5.0/CONTRIBUTING.md0000644000004100000410000000247012142363146015444 0ustar www-datawww-dataWe love pull requests. Here's a quick guide: 1. Fork the repo. 2. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: `bundle && rake` 3. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test! 4. Make the test pass. 5. Push to your fork and submit a pull request. At this point you're waiting on us. We like to at least comment on, if not accept, pull requests within three business days (and, typically, one business day). We may suggest some changes or improvements or alternatives. Some things that will increase the chance that your pull request is accepted, taken straight from the Ruby on Rails guide: * Use Rails idioms and helpers * Include tests that fail without your code, and pass with it * Update the documentation, the surrounding one, examples elsewhere, guides, whatever is affected by your contribution Syntax: * Two spaces, no tabs. * No trailing whitespace. Blank lines should not have any space. * Prefer &&/|| over and/or. * MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg. * a = b and not a=b. * Follow the conventions you see used in the source already. And in case we didn't emphasize it enough: we love tests! shoulda-3.5.0/README.md0000644000004100000410000000530712142363146014474 0ustar www-datawww-data# shoulda [![Gem Version](https://badge.fury.io/rb/shoulda.png)](http://badge.fury.io/rb/shoulda) [![Build Status](https://secure.travis-ci.org/thoughtbot/shoulda.png)](http://travis-ci.org/thoughtbot/shoulda) The shoulda gem is a meta gem with two dependencies: * [shoulda-context](https://github.com/thoughtbot/shoulda-context) ([official documentation](http://rubydoc.info/github/thoughtbot/shoulda-context/master/frames)) * [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) ([official documentation](http://rubydoc.info/github/thoughtbot/shoulda-matchers/master/frames)) The following describes different use cases and combinations. rspec with shoulda-matchers --------------------------- This is what thoughtbot currently does. We write tests like: ```ruby describe Post do it { should belong_to(:user) } it { should validate_presence_of(:title) } end ``` The belong_to and validate_presence_of methods are the matchers. All matchers are Rails 3-specific. Add rspec-rails and shoulda-matchers to the project's Gemfile: ```ruby group :test do gem 'rspec-rails' gem 'shoulda-matchers' end ``` test/unit with shoulda ---------------------- For the folks who prefer Test::Unit, they'd write tests like: ```ruby class UserTest < Test::Unit::TestCase should have_many(:posts) should_not allow_value("blah").for(:email) end ``` The have_many and allow_value methods are the same kind of matchers seen in the RSpec example. They come from the shoulda-matchers gem. Add shoulda to the project's Gemfile: ```ruby group :test do gem 'shoulda' end ``` test/unit with shoulda-context ------------------------------ If you're not testing a Rails project or don't want to use the matchers, you can use shoulda-context independently to write tests like: ```ruby class CalculatorTest < Test::Unit::TestCase context "a calculator" do setup do @calculator = Calculator.new end should "add two numbers for the sum" do assert_equal 4, @calculator.sum(2, 2) end should "multiply two numbers for the product" do assert_equal 10, @calculator.product(2, 5) end end end ``` Add shoulda-context to the project's Gemfile: ```ruby group :test do gem 'shoulda-context' end ``` Credits ------- ![thoughtbot](http://thoughtbot.com/assets/tm/logo.png) Shoulda is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community) Thank you to all [the contributors](https://github.com/thoughtbot/shoulda/contributors)! The names and logos for thoughtbot are trademarks of thoughtbot, inc. License ------- Shoulda is Copyright © 2006-2013 Tammer Saleh and thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file. shoulda-3.5.0/gemfiles/0000755000004100000410000000000012142363146015003 5ustar www-datawww-datashoulda-3.5.0/gemfiles/3.1.gemfile.lock0000644000004100000410000000641512142363146017573 0ustar www-datawww-dataPATH remote: /Users/rmcgeary/work/oss/shoulda specs: shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) GEM remote: https://rubygems.org/ specs: actionmailer (3.1.4) actionpack (= 3.1.4) mail (~> 2.3.0) actionpack (3.1.4) activemodel (= 3.1.4) activesupport (= 3.1.4) builder (~> 3.0.0) erubis (~> 2.7.0) i18n (~> 0.6) rack (~> 1.3.6) rack-cache (~> 1.1) rack-mount (~> 0.8.2) rack-test (~> 0.6.1) sprockets (~> 2.0.3) activemodel (3.1.4) activesupport (= 3.1.4) builder (~> 3.0.0) i18n (~> 0.6) activerecord (3.1.4) activemodel (= 3.1.4) activesupport (= 3.1.4) arel (~> 2.2.3) tzinfo (~> 0.3.29) activeresource (3.1.4) activemodel (= 3.1.4) activesupport (= 3.1.4) activesupport (3.1.4) multi_json (~> 1.0) appraisal (0.4.1) bundler rake arel (2.2.3) aruba (0.4.11) childprocess (>= 0.2.3) cucumber (>= 1.1.1) ffi (>= 1.0.11) rspec (>= 2.7.0) builder (3.0.4) childprocess (0.3.9) ffi (~> 1.0, >= 1.0.11) cucumber (1.1.9) builder (>= 2.1.2) diff-lcs (>= 1.1.2) gherkin (~> 2.9.0) json (>= 1.4.6) term-ansicolor (>= 1.0.6) diff-lcs (1.1.3) erubis (2.7.0) ffi (1.8.1) gherkin (2.9.3) json (>= 1.4.6) hike (1.2.2) i18n (0.6.4) jquery-rails (2.2.1) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.7.7) mail (2.3.3) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.23) multi_json (1.7.3) polyglot (0.3.3) rack (1.3.10) rack-cache (1.2) rack (>= 0.4) rack-mount (0.8.3) rack (>= 1.0.0) rack-ssl (1.3.3) rack rack-test (0.6.2) rack (>= 1.0) rails (3.1.4) actionmailer (= 3.1.4) actionpack (= 3.1.4) activerecord (= 3.1.4) activeresource (= 3.1.4) activesupport (= 3.1.4) bundler (~> 1.0) railties (= 3.1.4) railties (3.1.4) actionpack (= 3.1.4) activesupport (= 3.1.4) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.6) rake (10.0.4) rdoc (3.12.2) json (~> 1.4) rspec (2.7.0) rspec-core (~> 2.7.0) rspec-expectations (~> 2.7.0) rspec-mocks (~> 2.7.0) rspec-core (2.7.1) rspec-expectations (2.7.0) diff-lcs (~> 1.1.2) rspec-mocks (2.7.0) rspec-rails (2.7.0) actionpack (~> 3.0) activesupport (~> 3.0) railties (~> 3.0) rspec (~> 2.7.0) sass (3.2.8) sass-rails (3.1.0) actionpack (~> 3.1.0) railties (~> 3.1.0) sass (>= 3.1.4) shoulda-context (1.1.1) shoulda-matchers (2.1.0) activesupport (>= 3.0.0) sprockets (2.0.4) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.7) term-ansicolor (1.1.5) thor (0.14.6) tilt (1.4.0) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.37) PLATFORMS ruby DEPENDENCIES appraisal (~> 0.4.0) aruba (~> 0.4.11) cucumber (~> 1.1.0) jquery-rails rails (= 3.1.4) rspec-rails (~> 2.7.0) sass-rails shoulda! sqlite3 (~> 1.3.2) shoulda-3.5.0/gemfiles/3.0.gemfile0000644000004100000410000000016212142363146016634 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rails", "3.0.12" gemspec :path=>"../"shoulda-3.5.0/gemfiles/3.0.gemfile.lock0000644000004100000410000000555312142363146017574 0ustar www-datawww-dataPATH remote: /Users/rmcgeary/work/oss/shoulda specs: shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) GEM remote: https://rubygems.org/ specs: abstract (1.0.0) actionmailer (3.0.12) actionpack (= 3.0.12) mail (~> 2.2.19) actionpack (3.0.12) activemodel (= 3.0.12) activesupport (= 3.0.12) builder (~> 2.1.2) erubis (~> 2.6.6) i18n (~> 0.5.0) rack (~> 1.2.5) rack-mount (~> 0.6.14) rack-test (~> 0.5.7) tzinfo (~> 0.3.23) activemodel (3.0.12) activesupport (= 3.0.12) builder (~> 2.1.2) i18n (~> 0.5.0) activerecord (3.0.12) activemodel (= 3.0.12) activesupport (= 3.0.12) arel (~> 2.0.10) tzinfo (~> 0.3.23) activeresource (3.0.12) activemodel (= 3.0.12) activesupport (= 3.0.12) activesupport (3.0.12) appraisal (0.4.1) bundler rake arel (2.0.10) aruba (0.4.11) childprocess (>= 0.2.3) cucumber (>= 1.1.1) ffi (>= 1.0.11) rspec (>= 2.7.0) builder (2.1.2) childprocess (0.3.9) ffi (~> 1.0, >= 1.0.11) cucumber (1.1.9) builder (>= 2.1.2) diff-lcs (>= 1.1.2) gherkin (~> 2.9.0) json (>= 1.4.6) term-ansicolor (>= 1.0.6) diff-lcs (1.1.3) erubis (2.6.6) abstract (>= 1.0.0) ffi (1.8.1) gherkin (2.9.3) json (>= 1.4.6) i18n (0.5.0) json (1.7.7) mail (2.2.19) activesupport (>= 2.3.6) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.23) polyglot (0.3.3) rack (1.2.8) rack-mount (0.6.14) rack (>= 1.0.0) rack-test (0.5.7) rack (>= 1.0) rails (3.0.12) actionmailer (= 3.0.12) actionpack (= 3.0.12) activerecord (= 3.0.12) activeresource (= 3.0.12) activesupport (= 3.0.12) bundler (~> 1.0) railties (= 3.0.12) railties (3.0.12) actionpack (= 3.0.12) activesupport (= 3.0.12) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.4) rake (10.0.4) rdoc (3.12.2) json (~> 1.4) rspec (2.7.0) rspec-core (~> 2.7.0) rspec-expectations (~> 2.7.0) rspec-mocks (~> 2.7.0) rspec-core (2.7.1) rspec-expectations (2.7.0) diff-lcs (~> 1.1.2) rspec-mocks (2.7.0) rspec-rails (2.7.0) actionpack (~> 3.0) activesupport (~> 3.0) railties (~> 3.0) rspec (~> 2.7.0) shoulda-context (1.1.1) shoulda-matchers (2.1.0) activesupport (>= 3.0.0) sqlite3 (1.3.7) term-ansicolor (1.1.5) thor (0.14.6) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.37) PLATFORMS ruby DEPENDENCIES appraisal (~> 0.4.0) aruba (~> 0.4.11) cucumber (~> 1.1.0) rails (= 3.0.12) rspec-rails (~> 2.7.0) shoulda! sqlite3 (~> 1.3.2) shoulda-3.5.0/gemfiles/3.1.gemfile0000644000004100000410000000022512142363146016635 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rails", "3.1.4" gem "jquery-rails" gem "sass-rails" gemspec :path=>"../"shoulda-3.5.0/gemfiles/3.2.gemfile.lock0000644000004100000410000000632512142363146017574 0ustar www-datawww-dataPATH remote: /Users/rmcgeary/work/oss/shoulda specs: shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) GEM remote: https://rubygems.org/ specs: actionmailer (3.2.3) actionpack (= 3.2.3) mail (~> 2.4.4) actionpack (3.2.3) activemodel (= 3.2.3) activesupport (= 3.2.3) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.1) rack (~> 1.4.0) rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.1.2) activemodel (3.2.3) activesupport (= 3.2.3) builder (~> 3.0.0) activerecord (3.2.3) activemodel (= 3.2.3) activesupport (= 3.2.3) arel (~> 3.0.2) tzinfo (~> 0.3.29) activeresource (3.2.3) activemodel (= 3.2.3) activesupport (= 3.2.3) activesupport (3.2.3) i18n (~> 0.6) multi_json (~> 1.0) appraisal (0.4.1) bundler rake arel (3.0.2) aruba (0.4.11) childprocess (>= 0.2.3) cucumber (>= 1.1.1) ffi (>= 1.0.11) rspec (>= 2.7.0) builder (3.0.4) childprocess (0.3.9) ffi (~> 1.0, >= 1.0.11) cucumber (1.1.9) builder (>= 2.1.2) diff-lcs (>= 1.1.2) gherkin (~> 2.9.0) json (>= 1.4.6) term-ansicolor (>= 1.0.6) diff-lcs (1.1.3) erubis (2.7.0) ffi (1.8.1) gherkin (2.9.3) json (>= 1.4.6) hike (1.2.2) i18n (0.6.4) journey (1.0.4) jquery-rails (2.2.1) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.7.7) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.23) multi_json (1.7.3) polyglot (0.3.3) rack (1.4.5) rack-cache (1.2) rack (>= 0.4) rack-ssl (1.3.3) rack rack-test (0.6.2) rack (>= 1.0) rails (3.2.3) actionmailer (= 3.2.3) actionpack (= 3.2.3) activerecord (= 3.2.3) activeresource (= 3.2.3) activesupport (= 3.2.3) bundler (~> 1.0) railties (= 3.2.3) railties (3.2.3) actionpack (= 3.2.3) activesupport (= 3.2.3) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.6) rake (10.0.4) rdoc (3.12.2) json (~> 1.4) rspec (2.7.0) rspec-core (~> 2.7.0) rspec-expectations (~> 2.7.0) rspec-mocks (~> 2.7.0) rspec-core (2.7.1) rspec-expectations (2.7.0) diff-lcs (~> 1.1.2) rspec-mocks (2.7.0) rspec-rails (2.7.0) actionpack (~> 3.0) activesupport (~> 3.0) railties (~> 3.0) rspec (~> 2.7.0) sass (3.2.8) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) shoulda-context (1.1.1) shoulda-matchers (2.1.0) activesupport (>= 3.0.0) sprockets (2.1.3) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.7) term-ansicolor (1.1.5) thor (0.14.6) tilt (1.4.0) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.37) PLATFORMS ruby DEPENDENCIES appraisal (~> 0.4.0) aruba (~> 0.4.11) cucumber (~> 1.1.0) jquery-rails rails (= 3.2.3) rspec-rails (~> 2.7.0) sass-rails shoulda! sqlite3 (~> 1.3.2) shoulda-3.5.0/gemfiles/3.2.gemfile0000644000004100000410000000022512142363146016636 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rails", "3.2.3" gem "jquery-rails" gem "sass-rails" gemspec :path=>"../"shoulda-3.5.0/Rakefile0000644000004100000410000000067712142363146014667 0ustar www-datawww-datarequire 'bundler/setup' require 'bundler/gem_tasks' require 'cucumber/rake/task' require 'appraisal' Cucumber::Rake::Task.new do |t| t.fork = true t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')] end desc 'Test the plugin under all supported Rails versions.' task :all => ["appraisal:cleanup", "appraisal:install"] do exec('rake appraisal cucumber') end desc 'Default: run cucumber features' task :default => [:all] shoulda-3.5.0/features/0000755000004100000410000000000012142363146015026 5ustar www-datawww-datashoulda-3.5.0/features/rails_integration.feature0000644000004100000410000000534212142363146022124 0ustar www-datawww-data@disable-bundler Feature: integrate with Rails Background: When I generate a new rails application And I write to "db/migrate/1_create_users.rb" with: """ class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name end end end """ When I successfully run `bundle exec rake db:migrate --trace` And I write to "app/models/user.rb" with: """ class User < ActiveRecord::Base validates_presence_of :name end """ When I write to "app/controllers/examples_controller.rb" with: """ class ExamplesController < ApplicationController def show @example = 'hello' render :nothing => true end end """ When I configure a wildcard route Scenario: generate a rails application and use matchers in Test::Unit When I configure the application to use shoulda And I write to "test/unit/user_test.rb" with: """ require 'test_helper' class UserTest < ActiveSupport::TestCase should validate_presence_of(:name) end """ When I write to "test/functional/examples_controller_test.rb" with: """ require 'test_helper' class ExamplesControllerTest < ActionController::TestCase def setup get :show end should respond_with(:success) should assign_to(:example) end """ When I successfully run `bundle exec rake test TESTOPTS='-v' --trace` Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors" And the output should contain "2 tests, 2 assertions, 0 failures, 0 errors" And the output should contain "User should require name to be set" And the output should contain "ExamplesController should assign @example" Scenario: generate a rails application and use matchers in Rspec When I configure the application to use rspec-rails And I configure the application to use shoulda-matchers And I run the rspec generator And I write to "spec/models/user_spec.rb" with: """ require 'spec_helper' describe User do it { should validate_presence_of(:name) } end """ When I write to "spec/controllers/examples_controller_spec.rb" with: """ require 'spec_helper' describe ExamplesController, "show" do before { get :show } it { should assign_to(:example) } end """ When I successfully run `bundle exec rake spec SPEC_OPTS=-fs --trace` Then the output should contain "2 examples, 0 failures" And the output should contain "should require name to be set" And the output should contain "should assign @example" shoulda-3.5.0/features/step_definitions/0000755000004100000410000000000012142363146020374 5ustar www-datawww-datashoulda-3.5.0/features/step_definitions/rails_steps.rb0000644000004100000410000000401712142363146023253 0ustar www-datawww-dataPROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze APP_NAME = 'testapp'.freeze When /^I generate a new rails application$/ do steps %{ When I run `bundle exec rails new #{APP_NAME}` And I cd to "#{APP_NAME}" And I write to "Gemfile" with: """ source "http://rubygems.org" gem 'rails', '3.0.12' gem 'sqlite3' """ And I successfully run `bundle install --local` } end When /^I configure the application to use "([^\"]+)" from this project$/ do |name| append_to_gemfile "gem '#{name}', :path => '#{PROJECT_ROOT}'" steps %{And I run `bundle install --local`} end When /^I run the rspec generator$/ do steps %{ When I successfully run `rails generate rspec:install` } end When /^I configure the application to use rspec\-rails$/ do append_to_gemfile "gem 'rspec-rails'" steps %{And I run `bundle install --local`} end When /^I configure the application to use shoulda-context$/ do append_to_gemfile "gem 'shoulda-context'" steps %{And I run `bundle install --local`} end When /^I configure the application to use shoulda$/ do append_to_gemfile "gem 'shoulda-matchers', '~> 1.0', :require => false" append_to_gemfile "gem 'shoulda-context', '~> 1.0', :require => false" append_to_gemfile "gem 'shoulda', :path => '../../..'" steps %{And I run `bundle install --local`} end When /^I configure the application to use shoulda-matchers$/ do append_to_gemfile "gem 'shoulda-matchers', '~> 1.0'" steps %{And I run `bundle install --local`} end When /^I configure a wildcard route$/ do steps %{ When I write to "config/routes.rb" with: """ Rails.application.routes.draw do match ':controller(/:action(/:id(.:format)))' end """ } end module AppendHelpers def append_to(path, contents) in_current_dir do File.open(path, "a") do |file| file.puts file.puts contents end end end def append_to_gemfile(contents) append_to('Gemfile', contents) end end World(AppendHelpers) shoulda-3.5.0/features/support/0000755000004100000410000000000012142363146016542 5ustar www-datawww-datashoulda-3.5.0/features/support/env.rb0000644000004100000410000000036312142363146017661 0ustar www-datawww-datarequire 'aruba/cucumber' Before do @aruba_timeout_seconds = 15 if ENV['DEBUG'] @puts = true @announce_stdout = true @announce_stderr = true @announce_cmd = true @announce_dir = true @announce_env = true end end shoulda-3.5.0/Appraisals0000644000004100000410000000033212142363146015230 0ustar www-datawww-dataappraise '3.0' do gem 'rails', '3.0.12' end appraise '3.1' do gem 'rails', '3.1.4' gem 'jquery-rails' gem 'sass-rails' end appraise '3.2' do gem 'rails', '3.2.3' gem 'jquery-rails' gem 'sass-rails' end shoulda-3.5.0/checksums.yaml.gz0000444000004100000410000000064712142363146016505 0ustar www-datawww-dataLQA0Sl9, 0clM%`[$ 4n7~޺5z9,{yDuݽއVneꔀ(e}Z yrL3ڣ>xT}w:nRjD]d˕"#Wͨ=rm;[yO4e /DνpZ$ٖ4)17\Q@O:{fՍa0=%s1Xe6|yV_.&Of]z((A ;n")XPL֖TL;b.N|!iC8|?41Hhգv¢L~nևY Қi'a_fF$dI]Amn€"0um~zfshoulda-3.5.0/metadata.yml0000644000004100000410000001116412142363146015516 0ustar www-datawww-data--- !ruby/object:Gem::Specification name: shoulda version: !ruby/object:Gem::Version version: 3.5.0 platform: ruby authors: - Tammer Saleh - Joe Ferris - Ryan McGeary - Dan Croak - Matt Jankowski autorequire: bindir: bin cert_chain: [] date: 2013-05-07 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: '1.0' - - ! '>=' - !ruby/object:Gem::Version version: 1.0.1 version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: '1.0' - - ! '>=' - !ruby/object:Gem::Version version: 1.0.1 type: :runtime prerelease: false name: shoulda-context - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - ! '>=' - !ruby/object:Gem::Version version: 1.4.1 - - < - !ruby/object:Gem::Version version: '3.0' version_requirements: !ruby/object:Gem::Requirement requirements: - - ! '>=' - !ruby/object:Gem::Version version: 1.4.1 - - < - !ruby/object:Gem::Version version: '3.0' type: :runtime prerelease: false name: shoulda-matchers - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 0.4.0 version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 0.4.0 type: :development prerelease: false name: appraisal - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - '=' - !ruby/object:Gem::Version version: 3.0.12 version_requirements: !ruby/object:Gem::Requirement requirements: - - '=' - !ruby/object:Gem::Version version: 3.0.12 type: :development prerelease: false name: rails - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 1.3.2 version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 1.3.2 type: :development prerelease: false name: sqlite3 - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 2.7.0 version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 2.7.0 type: :development prerelease: false name: rspec-rails - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 1.1.0 version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 1.1.0 type: :development prerelease: false name: cucumber - !ruby/object:Gem::Dependency requirement: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 0.4.11 version_requirements: !ruby/object:Gem::Requirement requirements: - - ~> - !ruby/object:Gem::Version version: 0.4.11 type: :development prerelease: false name: aruba description: Making tests easy on the fingers and eyes email: support@thoughtbot.com executables: [] extensions: [] extra_rdoc_files: [] files: - .autotest - .gitignore - .travis.yml - Appraisals - CONTRIBUTING.md - Gemfile - MIT-LICENSE - README.md - Rakefile - features/rails_integration.feature - features/step_definitions/rails_steps.rb - features/support/env.rb - gemfiles/3.0.gemfile - gemfiles/3.0.gemfile.lock - gemfiles/3.1.gemfile - gemfiles/3.1.gemfile.lock - gemfiles/3.2.gemfile - gemfiles/3.2.gemfile.lock - lib/shoulda.rb - lib/shoulda/version.rb - shoulda.gemspec homepage: https://github.com/thoughtbot/shoulda licenses: - MIT metadata: {} post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 2.0.3 signing_key: specification_version: 4 summary: Making tests easy on the fingers and eyes test_files: - features/rails_integration.feature - features/step_definitions/rails_steps.rb - features/support/env.rb shoulda-3.5.0/Gemfile0000644000004100000410000000004712142363146014504 0ustar www-datawww-datasource 'https://rubygems.org' gemspec shoulda-3.5.0/.autotest0000644000004100000410000000051712142363146015064 0ustar www-datawww-dataAutotest.add_hook :initialize do |at| at.add_mapping(%r{^lib/\w.*\.rb}) do at.files_matching(%r{^test/*/\w.*_test\.rb}) end at.add_mapping(%r{^test/rails_root/\w.*}) do at.files_matching(%r{^test/*/\w.*_test\.rb}) end at.add_exception(%r{.svn}) at.add_exception(%r{.log$}) at.add_exception(%r{^.autotest$}) end shoulda-3.5.0/.gitignore0000644000004100000410000000012212142363146015173 0ustar www-datawww-datatest/*/log/*.log doc coverage .svn/ pkg *.swp *.swo tags tmp .bundle Gemfile.lock shoulda-3.5.0/lib/0000755000004100000410000000000012142363146013756 5ustar www-datawww-datashoulda-3.5.0/lib/shoulda/0000755000004100000410000000000012142363146015415 5ustar www-datawww-datashoulda-3.5.0/lib/shoulda/version.rb0000644000004100000410000000004712142363146017430 0ustar www-datawww-datamodule Shoulda VERSION = "3.5.0" end shoulda-3.5.0/lib/shoulda.rb0000644000004100000410000000011712142363146015741 0ustar www-datawww-datarequire 'shoulda/version' require 'shoulda/matchers' require 'shoulda/context'