shoulda-4.0.0/0000755000004100000410000000000013701111012013165 5ustar www-datawww-datashoulda-4.0.0/.travis.yml0000644000004100000410000000154513701111011015302 0ustar www-datawww-datalanguage: ruby dist: xenial os: linux cache: directories: - vendor/bundle # Source: before_install: - gem update --system '3.1.2' --no-document - gem uninstall -v '< 2' -i $(rvm gemdir)@global -ax bundler || true - gem install bundler -v '< 2' --no-document - nvm use v11.0.0 - bundle config set path vendor/bundle install: "bundle install --jobs=3 --retry=3" script: "bundle exec rake" rvm: - 2.4.9 - 2.5.8 - 2.6.6 - 2.7.1 gemfile: - gemfiles/rails_4_2.gemfile - gemfiles/rails_5_0.gemfile - gemfiles/rails_5_1.gemfile - gemfiles/rails_5_2.gemfile - gemfiles/rails_6_0.gemfile matrix: exclude: - rvm: 2.4.9 gemfile: gemfiles/rails_6_0.gemfile - rvm: 2.6.6 gemfile: gemfiles/rails_4_2.gemfile - rvm: 2.7.1 gemfile: gemfiles/rails_4_2.gemfile shoulda-4.0.0/test/0000755000004100000410000000000013701111012014144 5ustar www-datawww-datashoulda-4.0.0/test/acceptance/0000755000004100000410000000000013701111012016232 5ustar www-datawww-datashoulda-4.0.0/test/acceptance/integrates_with_rails_test.rb0000644000004100000410000004270213701111012024215 0ustar www-datawww-datarequire 'acceptance_test_helper' class ShouldaIntegratesWithRailsTest < AcceptanceTest # rubocop:disable Metrics/AbcSize, Metrics/MethodLength def setup app.create app.write_file 'db/migrate/1_create_users.rb', <<-FILE class CreateUsers < #{app.migration_class_name} def self.up create_table :categories_users do |t| t.integer :category_id t.integer :user_id end create_table :categories do |t| end create_table :cities do |t| end create_table :lives do |t| t.integer :user_id end create_table :issues do |t| t.integer :user_id end create_table :users do |t| t.integer :account_id t.integer :city_id t.string :email t.integer :age t.integer :status t.string :aspects end add_index :users, :account_id end end FILE app.run_migrations! app.write_file 'app/models/category.rb', <<-FILE class Category < ActiveRecord::Base end FILE app.write_file 'app/models/city.rb', <<-FILE class City < ActiveRecord::Base end FILE app.write_file 'app/models/issue.rb', <<-FILE class Issue < ActiveRecord::Base end FILE app.write_file 'app/models/life.rb', <<-FILE class Life < ActiveRecord::Base end FILE app.write_file 'app/models/person.rb', <<-FILE class Person # Note: All of these validations are listed in the same order as what's # defined in the test (see below) include ActiveModel::Model include ActiveModel::SecurePassword attr_accessor( :age, :card_number, :email, :foods, :nothing, :password_digest, :some_other_attribute, :some_other_attribute_confirmation, :something, :terms_of_service, :workouts, :some_other_attribute, ) validate :email_looks_like_an_email delegate :a_method, to: :some_delegate_object has_secure_password validates_absence_of :nothing validates_acceptance_of :terms_of_service validates_confirmation_of :password validates_exclusion_of :workouts, in: ["biceps"] validates_inclusion_of :foods, in: ["spaghetti"] validates_length_of :card_number, maximum: 16 validates_numericality_of :age validates_presence_of :something def some_delegate_object Object.new.instance_eval do def a_method; end end end private def email_looks_like_an_email if email !~ /@/ errors.add :email, "invalid" end end end FILE app.write_file 'app/models/user.rb', <<-FILE class User < ActiveRecord::Base # Note: All of these validations are listed in the same order as what's # defined in the test (see below) belongs_to :city enum status: { inactive: 0, active: 1 } attr_readonly :username has_and_belongs_to_many :categories has_many :issues has_one :life serialize :aspects validates_uniqueness_of :email accepts_nested_attributes_for :issues end FILE app.write_file 'app/controllers/examples_controller.rb', <<-FILE class ExamplesController < ApplicationController # Note: All of these validations are listed in the same order as what's # defined in the test (see below) before_action :some_before_action after_action :some_after_action around_action :some_around_action rescue_from ActiveRecord::RecordNotFound, with: :handle_not_found layout "application" def index render :index head :ok end def create create_params flash[:success] = "Example created" session[:some_key] = "some value" redirect_to action: :index end def handle_not_found end private def some_before_action end def some_after_action end def some_around_action yield end def create_params params.require(:user).permit(:email, :password) end end FILE app.write_file 'app/views/examples/index.html.erb', <<-FILE Some content here FILE app.write_file 'config/routes.rb', <<-FILE Rails.application.routes.draw do resources :examples, only: [:index, :create] end FILE end def test_succeeding_assertions_for_active_model app.write_file 'test/models/person_test.rb', <<-FILE require 'test_helper' class PersonTest < ActiveSupport::TestCase # Note: All of these matchers are listed in alphabetical order so we can # compare with what is listed inside of the shoulda-matchers README should allow_value("john@smith.com").for(:email) should_not allow_value("john").for(:email) should delegate_method(:a_method).to(:some_delegate_object) should_not delegate_method(:some_other_method).to(:some_other_object) should have_secure_password should validate_absence_of(:nothing) should_not validate_absence_of(:some_other_attribute) should validate_acceptance_of(:terms_of_service) should_not validate_acceptance_of(:some_other_attribute) should validate_confirmation_of(:password) should_not validate_confirmation_of(:some_other_attribute) should validate_exclusion_of(:workouts).in_array(["biceps"]) should_not validate_exclusion_of(:some_other_attribute). in_array(["whatever"]) should validate_inclusion_of(:foods).in_array(["spaghetti"]) should_not validate_inclusion_of(:some_other_attribute). in_array(["whatever"]) should validate_length_of(:card_number).is_at_most(16) should_not validate_length_of(:some_other_attribute).is_at_most(16) should validate_numericality_of(:age) should_not validate_numericality_of(:some_other_attribute) should validate_presence_of(:something) should_not validate_presence_of(:some_other_attribute) end FILE result = app.run_n_unit_test_suite assert_accepts indicate_that_tests_were_run(failures: 0), result end def test_succeeding_assertions_for_active_record app.write_file 'test/models/user_test.rb', <<-FILE require 'test_helper' class UserTest < ActiveSupport::TestCase # Note: All of these matchers are listed in alphabetical order so we can # compare with what is listed inside of the shoulda-matchers README should belong_to(:city) should_not belong_to(:some_other_attribute) should define_enum_for(:status).with_values(inactive: 0, active: 1) should_not define_enum_for(:status).with_values(foo: "bar") should have_db_column(:age) should_not have_db_column(:some_other_attribute) should have_db_index(:account_id) should_not have_db_index(:some_other_attribute) should have_readonly_attribute(:username) should_not have_readonly_attribute(:some_other_attribute) should have_and_belong_to_many(:categories) should_not have_and_belong_to_many(:whatevers) should have_many(:issues) should_not have_many(:whatevers) should have_one(:life) should_not have_one(:whatever) should serialize(:aspects) should_not serialize(:age) should validate_uniqueness_of(:email) should_not validate_uniqueness_of(:some_other_attribute) should accept_nested_attributes_for(:issues) should_not accept_nested_attributes_for(:some_other_attribute) end FILE result = app.run_n_unit_test_suite assert_accepts indicate_that_tests_were_run(failures: 0), result end def test_succeeding_assertions_for_action_controller app.write_file 'test/controllers/examples_controller_test.rb', <<-FILE require 'test_helper' class ExamplesControllerTest < ActionController::TestCase context "GET #index" do setup do get :index end # Note: All of these matchers are listed in alphabetical order so we # can compare with what is listed inside of the shoulda-matchers # README should use_before_action(:some_before_action) should_not use_before_action(:some_other_before_action) should use_after_action(:some_after_action) should_not use_after_action(:some_other_after_action) should use_around_action(:some_around_action) should_not use_around_action(:some_other_around_action) # This is one of the defaults for Rails should filter_param(:password) should_not filter_param(:some_other_param) should rescue_from(ActiveRecord::RecordNotFound). with(:handle_not_found) should_not rescue_from(ActiveRecord::RecordNotFound). with(:some_other_method) should render_template(:index) should_not render_template(:some_other_action) should render_with_layout("application") should_not render_with_layout("some_other_layout") should respond_with(:ok) should_not respond_with(:some_other_status) should route(:get, "/examples").to(action: :index) should_not route(:get, "/examples").to(action: :something_else) end context "POST #create" do setup do if ActionPack::VERSION::STRING.start_with?("4.") post :create, { user: { email: "some@email.com", password: "somepassword" } } else post :create, params: { user: { email: "some@email.com", password: "somepassword" } } end end should permit(:email, :password). for(:create, params: { user: { email: "some@email.com", password: "somepassword" } }). on(:user) should_not permit(:foo, :bar). for(:create, params: { user: { email: "some@email.com", password: "somepassword" } }). on(:user) should redirect_to("/examples") should_not redirect_to("/something_else") should set_flash[:success].to("Example created") should_not set_flash[:success].to("Something else") should set_session[:some_key].to("some value") should_not set_session[:some_key].to("some other value") end end FILE result = app.run_n_unit_test_suite assert_accepts indicate_that_tests_were_run(failures: 0), result end def test_failing_assertions_for_active_model app.write_file 'test/models/person_test.rb', <<-FILE require 'test_helper' class PersonTest < ActiveSupport::TestCase # Note: All of these matchers are listed in alphabetical order so we can # compare with what is listed inside of the shoulda-matchers README should_not allow_value("john@smith.com").for(:email) should allow_value("john").for(:email) # FIXME: See #1187 in shoulda-matchers #should_not have_secure_password should_not validate_absence_of(:nothing) should validate_absence_of(:some_other_attribute) should_not validate_acceptance_of(:terms_of_service) should validate_acceptance_of(:some_other_attribute) should_not validate_confirmation_of(:password) should validate_confirmation_of(:some_other_attribute) should_not validate_exclusion_of(:workouts).in_array(["biceps"]) should validate_exclusion_of(:some_other_attribute). in_array(["whatever"]) should_not validate_inclusion_of(:foods).in_array(["spaghetti"]) should validate_inclusion_of(:some_other_attribute). in_array(["whatever"]) should_not validate_length_of(:card_number).is_at_most(16) should validate_length_of(:some_other_attribute).is_at_most(16) should_not validate_numericality_of(:age) should validate_numericality_of(:some_other_attribute) should_not validate_presence_of(:something) should validate_presence_of(:some_other_attribute) should_not delegate_method(:a_method).to(:some_delegate_object) should delegate_method(:some_other_method).to(:some_other_object) end FILE result = app.run_n_unit_test_suite assert_accepts indicate_that_tests_were_run(failures: 20), result end def test_failing_assertions_for_active_record app.write_file 'test/models/user_test.rb', <<-FILE require 'test_helper' class UserTest < ActiveSupport::TestCase # Note: All of these matchers are listed in alphabetical order so we can # compare with what is listed inside of the shoulda-matchers README should_not belong_to(:city) should belong_to(:some_other_attribute) should_not define_enum_for(:status).with_values(inactive: 0, active: 1) should define_enum_for(:status).with_values(foo: "bar") should_not have_db_column(:age) should have_db_column(:some_other_attribute) should_not have_db_index(:account_id) should have_db_index(:some_other_attribute) should_not have_readonly_attribute(:username) should have_readonly_attribute(:some_other_attribute) should_not have_and_belong_to_many(:categories) should have_and_belong_to_many(:whatevers) should_not have_many(:issues) should have_many(:whatevers) should_not have_one(:life) should have_one(:whatever) should_not serialize(:aspects) should serialize(:age) should_not validate_uniqueness_of(:email) should validate_uniqueness_of(:some_other_attribute) should_not accept_nested_attributes_for(:issues) should accept_nested_attributes_for(:some_other_attribute) end FILE result = app.run_n_unit_test_suite assert_accepts indicate_that_tests_were_run(failures: 22), result end def test_failing_assertions_for_action_controller app.write_file 'test/controllers/examples_controller_test.rb', <<-FILE require 'test_helper' class ExamplesControllerTest < ActionController::TestCase context "GET #index" do setup do get :index end # Note: All of these matchers are listed in alphabetical order so we # can compare with what is listed inside of the shoulda-matchers # README should_not use_before_action(:some_before_action) should use_before_action(:some_other_before_action) should_not use_after_action(:some_after_action) should use_after_action(:some_other_after_action) should_not use_around_action(:some_around_action) should use_around_action(:some_other_around_action) should_not filter_param(:password) should filter_param(:some_other_param) should_not rescue_from(ActiveRecord::RecordNotFound). with(:handle_not_found) should rescue_from(ActiveRecord::RecordNotFound). with(:some_other_method) should_not render_template(:index) should render_template(:some_other_action) should_not render_with_layout("application") should render_with_layout("some_other_layout") should_not respond_with(:ok) should respond_with(:some_other_status) should_not route(:get, "/examples").to(action: :index) should route(:get, "/examples").to(action: :something_else) end context "POST #create" do setup do if ActionPack::VERSION::STRING.start_with?("4.") post :create, { user: { email: "some@email.com", password: "somepassword" } } else post :create, params: { user: { email: "some@email.com", password: "somepassword" } } end end should_not permit(:email, :password). for(:create, params: { user: { email: "some@email.com", password: "somepassword" } }). on(:user) should permit(:foo, :bar). for(:create, params: { user: { email: "some@email.com", password: "somepassword" } }). on(:user) should_not redirect_to("/examples") should redirect_to("/something_else") should_not set_flash[:success].to("Example created") should set_flash[:success].to("Something else") should_not set_session[:some_key].to("some value") should set_session[:some_key].to("some other value") end end FILE result = app.run_n_unit_test_suite assert_accepts indicate_that_tests_were_run(failures: 26), result end # rubocop:enable Metrics/AbcSize, Metrics/MethodLength end shoulda-4.0.0/test/acceptance_test_helper.rb0000644000004100000410000000213113701111012021152 0ustar www-datawww-datarequire_relative 'support/current_bundle' Tests::CurrentBundle.instance.assert_appraisal! #--- require 'test_helper' require_relative 'support/acceptance/rails_application_with_shoulda' require_relative 'support/acceptance/matchers/have_output' require_relative 'support/acceptance/matchers/indicate_that_tests_were_run' class AcceptanceTest < Minitest::Test include AcceptanceTests::Matchers private def app @app ||= AcceptanceTests::RailsApplicationWithShoulda.new end end begin require 'rails/test_unit/reporter' # Patch Rails' reporter for Minitest so that it looks for the test # correctly under Minitest 5.11 # See: Rails::TestUnitReporter.class_eval do def format_rerun_snippet(result) location, line = if result.respond_to?(:source_location) result.source_location else result.method(result.name).source_location end "#{executable} #{relative_path_for(location)}:#{line}" end end rescue LoadError # Okay, rails/test_unit/reporter isn't a thing, no big deal end shoulda-4.0.0/test/support/0000755000004100000410000000000013701111012015660 5ustar www-datawww-datashoulda-4.0.0/test/support/current_bundle.rb0000644000004100000410000000207413701111012021223 0ustar www-datawww-datarequire 'bundler' require 'appraisal' module Tests class CurrentBundle AppraisalNotSpecified = Class.new(ArgumentError) include Singleton def assert_appraisal! unless appraisal_in_use? message = <`. Possible appraisals are: #{available_appraisals} MSG raise AppraisalNotSpecified, message end end def appraisal_in_use? path.dirname == root.join('gemfiles') end def current_or_latest_appraisal current_appraisal || latest_appraisal end def latest_appraisal available_appraisals.max end private def available_appraisals appraisals = [] Appraisal::AppraisalFile.each do |appraisal| appraisals << appraisal.name end appraisals end def current_appraisal if appraisal_in_use? File.basename(path, '.gemfile') end end def path Bundler.default_gemfile end def root Pathname.new('../../..').expand_path(__FILE__) end end end shoulda-4.0.0/test/support/acceptance/0000755000004100000410000000000013701111012017746 5ustar www-datawww-datashoulda-4.0.0/test/support/acceptance/helpers/0000755000004100000410000000000013701111012021410 5ustar www-datawww-datashoulda-4.0.0/test/support/acceptance/helpers/array_helpers.rb0000644000004100000410000000041313701111012024573 0ustar www-datawww-datamodule AcceptanceTests module ArrayHelpers def to_sentence(array) if array.size == 1 array[0] elsif array.size == 2 array.join(' and ') else to_sentence(array[1..-2].join(', '), [array[-1]]) end end end end shoulda-4.0.0/test/support/acceptance/helpers/pluralization_helpers.rb0000644000004100000410000000045613701111012026361 0ustar www-datawww-datamodule AcceptanceTests module PluralizationHelpers def pluralize(count, singular_version, plural_version = nil) plural_version ||= singular_version + 's' if count == 1 "#{count} #{singular_version}" else "#{count} #{plural_version}" end end end end shoulda-4.0.0/test/support/acceptance/matchers/0000755000004100000410000000000013701111012021554 5ustar www-datawww-datashoulda-4.0.0/test/support/acceptance/matchers/indicate_that_tests_were_run.rb0000644000004100000410000000514113701111012030032 0ustar www-datawww-datarequire_relative '../helpers/array_helpers' require_relative '../helpers/pluralization_helpers' module AcceptanceTests module Matchers def indicate_that_tests_were_run(series) IndicateThatTestsWereRunMatcher.new(series) end class IndicateThatTestsWereRunMatcher include ArrayHelpers include PluralizationHelpers def initialize(expected_numbers) @expected_numbers = expected_numbers end def matches?(runner) @runner = runner Set.new(expected_numbers).subset?(Set.new(actual_numbers)) end def failure_message "Expected output to indicate that #{some_tests_were_run}.\n" + "#{formatted_expected_numbers}\n" + "#{formatted_actual_numbers}\n\n" + "Output:\n\n" + actual_output end protected attr_reader :expected_numbers, :runner private def some_tests_were_run if some_tests_were_run_clauses.size > 1 "#{to_sentence(some_tests_were_run_clauses)} were run" else "#{some_tests_were_run_clauses} was run" end end def some_tests_were_run_clauses expected_numbers.map do |type, number| if number == 1 "#{number} #{type.to_s.chop}" else "#{number} #{type}" end end end def formatted_expected_numbers "Expected numbers: #{format_hash(expected_numbers)}" end def formatted_actual_numbers report_line = find_report_line_in(actual_output) if report_line "Actual numbers: #{report_line.inspect}" else 'Actual numbers: (n/a)' end end def actual_numbers numbers = parse( actual_output, [:tests, :assertions, :failures, :errors, :skips], ) numbers || {} end def actual_output runner.output end def parse(text, pieces) report_line = find_report_line_in(text) if report_line pieces.inject({}) do |hash, piece| number = report_line.match(/(\d+) #{piece}/)[1].to_i hash.merge(piece => number) end end end def find_report_line_in(text) lines = text.split(/\n/) index_of_line_with_time = lines.find_index do |line| line =~ /\AFinished in \d\.\d+s\Z/ end if index_of_line_with_time lines[index_of_line_with_time + 1] end end def format_hash(hash) '{' + hash.map { |k, v| "#{k}: #{v.inspect}" }.join(', ') + '}' end end end end shoulda-4.0.0/test/support/acceptance/matchers/have_output.rb0000644000004100000410000000134213701111012024444 0ustar www-datawww-datamodule AcceptanceTests module Matchers # rubocop:disable Naming/PredicateName def have_output(output) HaveOutputMatcher.new(output) end # rubocop:enable Naming/PredicateName class HaveOutputMatcher def initialize(output) @output = output end def matches?(runner) @runner = runner runner.has_output?(output) end def failure_message "Expected command to have output, but did not.\n\n" + "Command: #{runner.formatted_command}\n\n" + "Expected output:\n" + output.inspect + "\n\n" + "Actual output:\n" + runner.output end protected attr_reader :output, :runner end end end shoulda-4.0.0/test/support/acceptance/add_shoulda_to_project.rb0000644000004100000410000000267513701111012025004 0ustar www-datawww-datamodule AcceptanceTests class AddShouldaToProject ROOT_DIRECTORY = Pathname.new('../../..').expand_path(__FILE__) def self.call(app, options) new(app, options).call end def initialize(app, options) @app = app @options = options end def call app.add_gem 'shoulda', gem_options unless options[:with_configuration] === false add_configuration_block_to_test_helper end end private attr_reader :app, :options def test_framework options[:test_framework] end def libraries options.fetch(:libraries, []) end def gem_options gem_options = { path: ROOT_DIRECTORY } if options[:manually] gem_options[:require] = false end gem_options end def add_configuration_block_to_test_helper content = <<-CONTENT Shoulda::Matchers.configure do |config| config.integrate do |with| #{test_framework_config} #{library_config} end end CONTENT if options[:manually] content = "require 'shoulda'\n#{content}" end app.append_to_file('test/test_helper.rb', content) end def test_framework_config if test_framework "with.test_framework :#{test_framework}\n" else '' end end def library_config libraries.map { |library| "with.library :#{library}" }.join("\n") end end end shoulda-4.0.0/test/support/acceptance/rails_application_with_shoulda.rb0000644000004100000410000000254313701111012026546 0ustar www-datawww-datarequire_relative 'add_shoulda_to_project' require_relative '../snowglobe' module AcceptanceTests class RailsApplicationWithShoulda < Snowglobe::RailsApplication def create super bundle.updating do bundle.add_gem 'minitest-reporters' AddShouldaToProject.call( self, test_framework: :minitest, libraries: [:rails], ) end fs.append_to_file 'test/test_helper.rb', <<-FILE require 'minitest/autorun' require 'minitest/reporters' Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new) begin require "rails/test_unit/reporter" # Patch Rails' reporter for Minitest so that it looks for the test # correctly under Minitest 5.11 # See: Rails::TestUnitReporter.class_eval do def format_rerun_snippet(result) location, line = if result.respond_to?(:source_location) result.source_location else result.method(result.name).source_location end "\#{executable} \#{relative_path_for(location)}:\#{line}" end end rescue LoadError # Okay, rails/test_unit/reporter isn't a thing, no big deal end FILE end end end shoulda-4.0.0/test/support/snowglobe.rb0000644000004100000410000000013313701111012020201 0ustar www-datawww-datarequire 'snowglobe' Snowglobe.configure do |config| config.project_name = 'shoulda' end shoulda-4.0.0/test/test_helper.rb0000644000004100000410000000075613701111012017017 0ustar www-datawww-datarequire 'bundler/setup' require 'pry' require 'pry-byebug' require 'minitest/autorun' require 'minitest/reporters' require 'warnings_logger' require_relative '../lib/shoulda' Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new) WarningsLogger::Spy.call( project_name: 'shoulda', project_directory: Pathname.new('../..').expand_path(__FILE__), ) Shoulda::Matchers.configure do |config| config.integrate do |with| with.test_framework :minitest end end $VERBOSE = true shoulda-4.0.0/README.md0000644000004100000410000000601113701111011014441 0ustar www-datawww-data# Shoulda [![Gem Version][version-badge]][rubygems] [![Build Status][travis-badge]][travis] ![Downloads][downloads-badge] [![Hound][hound-badge]][hound] [version-badge]: http://img.shields.io/gem/v/shoulda.svg [rubygems]: http://rubygems.org/gems/shoulda [travis-badge]: http://img.shields.io/travis/thoughtbot/shoulda/master.svg [travis]: http://travis-ci.org/thoughtbot/shoulda [downloads-badge]: http://img.shields.io/gem/dtv/shoulda.svg [hound-badge]: https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg [hound]: https://houndci.com Shoulda helps you write more understandable, maintainable Rails-specific tests under Minitest and Test::Unit. ## Quick links 📢 **[See what's changed in recent versions.][changelog]** [changelog]: CHANGELOG.md ## Overview As a meta gem, the `shoulda` gem doesn't contain any code of its own but rather brings in behavior from two other gems: * [Shoulda Context] * [Shoulda Matchers] [Shoulda Context]: https://github.com/thoughtbot/shoulda-context [Shoulda Matchers]: https://github.com/thoughtbot/shoulda-matchers For instance: ```ruby require "test_helper" class UserTest < ActiveSupport::TestCase context "associations" do should have_many(:posts) end context "validations" do should validate_presence_of(:email) should allow_value("user@example.com").for(:email) should_not allow_value("not-an-email").for(:email) end context "#name" do should "consist of first and last name" do user = User.new(first_name: "John", last_name: "Smith") assert_equal "John Smith", user.name end end end ``` Here, the `context` and `should` methods come from Shoulda Context; matchers (e.g. `have_many`, `allow_value`) come from Shoulda Matchers. See the READMEs for these projects for more information. ## Compatibility Shoulda Matchers is [tested][travis] and supported against Ruby 2.4+, Rails 4.2.x+, RSpec 3.x, and Minitest 5.x. ## Contributing Shoulda is open source, and we are grateful for [everyone][contributors] who's contributed so far. [contributors]: https://github.com/thoughtbot/shoulda/contributors If you'd like to contribute, please take a look at the [instructions](CONTRIBUTING.md) for installing dependencies and crafting a good pull request. ## Versioning Shoulda follows Semantic Versioning 2.0 as defined at . ## License Shoulda is copyright © 2006-2019 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the [MIT-LICENSE](MIT-LICENSE) file. ## About thoughtbot ![thoughtbot][thoughtbot-logo] [thoughtbot-logo]: https://thoughtbot.com/brand_assets/93:44.svg Shoulda is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc. We love open source software! See [our other projects][community] or [hire us][hire] to design, develop, and grow your product. [community]: https://thoughtbot.com/community?utm_source=github [hire]: https://thoughtbot.com/hire-us?utm_source=github [thoughtbot]: https://thoughtbot.com?utm_source=github shoulda-4.0.0/gemfiles/0000755000004100000410000000000013701111011014757 5ustar www-datawww-datashoulda-4.0.0/gemfiles/rails_5_2.gemfile.lock0000644000004100000410000001446713701111011021033 0ustar www-datawww-dataPATH remote: .. specs: shoulda (4.0.0) shoulda-context (~> 2.0) shoulda-matchers (~> 4.0) GEM remote: https://rubygems.org/ specs: actioncable (5.2.4.2) actionpack (= 5.2.4.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) actionmailer (5.2.4.2) actionpack (= 5.2.4.2) actionview (= 5.2.4.2) activejob (= 5.2.4.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) actionpack (5.2.4.2) actionview (= 5.2.4.2) activesupport (= 5.2.4.2) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (5.2.4.2) activesupport (= 5.2.4.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) activejob (5.2.4.2) activesupport (= 5.2.4.2) globalid (>= 0.3.6) activemodel (5.2.4.2) activesupport (= 5.2.4.2) activerecord (5.2.4.2) activemodel (= 5.2.4.2) activesupport (= 5.2.4.2) arel (>= 9.0) activestorage (5.2.4.2) actionpack (= 5.2.4.2) activerecord (= 5.2.4.2) marcel (~> 0.3.1) activesupport (5.2.4.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) appraisal (2.2.0) bundler rake thor (>= 0.14.0) archive-zip (0.12.0) io-like (~> 0.3.0) arel (9.0.0) ast (2.4.0) bcrypt (3.1.13) bootsnap (1.4.6) msgpack (~> 1.0) builder (3.2.4) byebug (10.0.2) capybara (3.1.1) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) xpath (~> 3.0) childprocess (3.0.0) chromedriver-helper (2.1.1) archive-zip (~> 0.10) nokogiri (~> 1.8) coderay (1.1.2) concurrent-ruby (1.1.6) crass (1.0.6) erubi (1.9.0) ffi (1.12.2) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.8.2) concurrent-ruby (~> 1.0) io-like (0.3.1) jaro_winkler (1.5.4) jbuilder (2.10.0) activesupport (>= 5.0.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) m (1.5.1) method_source (>= 0.6.7) rake (>= 0.9.2.2) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) method_source (0.9.2) mimemagic (0.3.4) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.0) minitest-reporters (1.4.2) ansi builder minitest (>= 5.0) ruby-progressbar mry (0.78.0.0) rubocop (>= 0.41.0) msgpack (1.3.3) nio4r (2.5.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) parallel (1.19.1) parser (2.7.1.0) ast (~> 2.4.0) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-byebug (3.6.0) byebug (~> 10.0) pry (~> 0.10) public_suffix (4.0.3) puma (3.12.4) rack (2.2.2) rack-test (1.1.0) rack (>= 1.0, < 3) rails (5.2.4.2) actioncable (= 5.2.4.2) actionmailer (= 5.2.4.2) actionpack (= 5.2.4.2) actionview (= 5.2.4.2) activejob (= 5.2.4.2) activemodel (= 5.2.4.2) activerecord (= 5.2.4.2) activestorage (= 5.2.4.2) activesupport (= 5.2.4.2) bundler (>= 1.3.0) railties (= 5.2.4.2) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) actionview (>= 5.0.1.x) activesupport (>= 5.0.1.x) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) railties (5.2.4.2) actionpack (= 5.2.4.2) activesupport (= 5.2.4.2) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rainbow (3.0.0) rake (13.0.1) rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) rubocop (0.71.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) rubocop-rails (2.0.1) rack (>= 1.1) rubocop (>= 0.70.0) ruby-progressbar (1.10.1) ruby_dep (1.5.0) rubyzip (1.3.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.1.0) railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) shoulda-context (2.0.0) shoulda-matchers (4.3.0) activesupport (>= 4.2.0) snowglobe (0.3.0) spring (2.1.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.13) thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (1.2.7) thread_safe (~> 0.1) unicode-display_width (1.6.1) warnings_logger (0.1.0) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS ruby DEPENDENCIES appraisal (~> 2.1) bcrypt (~> 3.1.7) bootsnap (>= 1.1.0) bundler (~> 1.0) capybara (~> 3.1.1) chromedriver-helper jbuilder (~> 2.5) listen (>= 3.0.5, < 3.2) m minitest (~> 5.0) minitest-reporters mry pry (~> 0.12.0) pry-byebug (~> 3.6.0) puma (~> 3.11) rails (~> 5.2.2) rails-controller-testing (>= 1.0.1) rubocop (= 0.71.0) rubocop-rails rubyzip (~> 1.3.0) sass-rails (~> 5.0) selenium-webdriver shoulda! snowglobe (>= 0.3.0) spring spring-commands-rspec spring-watcher-listen (~> 2.0.0) sqlite3 (~> 1.3.6) turbolinks (~> 5) warnings_logger BUNDLED WITH 1.17.3 shoulda-4.0.0/gemfiles/rails_4_2.gemfile0000644000004100000410000000144313701111011020071 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.1" gem "bundler", "~> 1.0" gem "m" gem "minitest", "~> 5.0" gem "minitest-reporters" gem "mry" gem "pry", "~> 0.12.0" gem "pry-byebug", "~> 3.6.0" gem "rubocop", "0.71.0", require: false gem "rubocop-rails", require: false gem "snowglobe", ">= 0.3.0" gem "warnings_logger" gem "sqlite3", "~> 1.3.6" gem "rubyzip", "~> 1.3.0" gem "spring" gem "spring-commands-rspec" gem "rails", "~> 4.2.10" gem "sass-rails", "~> 5.0" gem "uglifier", ">= 1.3.0" gem "coffee-rails", "~> 4.1.0" gem "jquery-rails" gem "turbolinks" gem "jbuilder", "~> 2.0" gem "sdoc", "~> 0.4.0", group: :doc gem "bcrypt", "~> 3.1.7" gem "activeresource", "4.0.0" gem "json", "~> 1.4" gem "protected_attributes", "~> 1.0.6" gemspec path: "../" shoulda-4.0.0/gemfiles/rails_5_2.gemfile0000644000004100000410000000154313701111011020073 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.1" gem "bundler", "~> 1.0" gem "m" gem "minitest", "~> 5.0" gem "minitest-reporters" gem "mry" gem "pry", "~> 0.12.0" gem "pry-byebug", "~> 3.6.0" gem "rubocop", "0.71.0", require: false gem "rubocop-rails", require: false gem "snowglobe", ">= 0.3.0" gem "warnings_logger" gem "sqlite3", "~> 1.3.6" gem "rubyzip", "~> 1.3.0" gem "spring" gem "spring-commands-rspec" gem "rails", "~> 5.2.2" gem "rails-controller-testing", ">= 1.0.1" gem "puma", "~> 3.11" gem "bootsnap", ">= 1.1.0", require: false gem "sass-rails", "~> 5.0" gem "turbolinks", "~> 5" gem "jbuilder", "~> 2.5" gem "bcrypt", "~> 3.1.7" gem "capybara", "~> 3.1.1" gem "selenium-webdriver" gem "chromedriver-helper" gem "listen", ">= 3.0.5", "< 3.2" gem "spring-watcher-listen", "~> 2.0.0" gemspec path: "../" shoulda-4.0.0/gemfiles/rails_5_1.gemfile.lock0000644000004100000410000001344013701111011021020 0ustar www-datawww-dataPATH remote: .. specs: shoulda (4.0.0) shoulda-context (~> 2.0) shoulda-matchers (~> 4.0) GEM remote: https://rubygems.org/ specs: actioncable (5.1.7) actionpack (= 5.1.7) nio4r (~> 2.0) websocket-driver (~> 0.6.1) actionmailer (5.1.7) actionpack (= 5.1.7) actionview (= 5.1.7) activejob (= 5.1.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) actionpack (5.1.7) actionview (= 5.1.7) activesupport (= 5.1.7) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (5.1.7) activesupport (= 5.1.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) activejob (5.1.7) activesupport (= 5.1.7) globalid (>= 0.3.6) activemodel (5.1.7) activesupport (= 5.1.7) activerecord (5.1.7) activemodel (= 5.1.7) activesupport (= 5.1.7) arel (~> 8.0) activesupport (5.1.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) appraisal (2.2.0) bundler rake thor (>= 0.14.0) arel (8.0.0) ast (2.4.0) bcrypt (3.1.13) builder (3.2.4) byebug (10.0.2) capybara (2.18.0) addressable mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (>= 2.0, < 4.0) childprocess (3.0.0) coderay (1.1.2) concurrent-ruby (1.1.6) crass (1.0.6) erubi (1.9.0) ffi (1.12.2) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.8.2) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) jbuilder (2.10.0) activesupport (>= 5.0.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) m (1.5.1) method_source (>= 0.6.7) rake (>= 0.9.2.2) mail (2.7.1) mini_mime (>= 0.1.1) method_source (0.9.2) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.0) minitest-reporters (1.4.2) ansi builder minitest (>= 5.0) ruby-progressbar mry (0.78.0.0) rubocop (>= 0.41.0) nio4r (2.5.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) parallel (1.19.1) parser (2.7.1.0) ast (~> 2.4.0) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-byebug (3.6.0) byebug (~> 10.0) pry (~> 0.10) public_suffix (4.0.3) puma (3.12.4) rack (2.2.2) rack-test (1.1.0) rack (>= 1.0, < 3) rails (5.1.7) actioncable (= 5.1.7) actionmailer (= 5.1.7) actionpack (= 5.1.7) actionview (= 5.1.7) activejob (= 5.1.7) activemodel (= 5.1.7) activerecord (= 5.1.7) activesupport (= 5.1.7) bundler (>= 1.3.0) railties (= 5.1.7) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) actionview (>= 5.0.1.x) activesupport (>= 5.0.1.x) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) railties (5.1.7) actionpack (= 5.1.7) activesupport (= 5.1.7) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (3.0.0) rake (13.0.1) rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) rubocop (0.71.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) rubocop-rails (2.0.1) rack (>= 1.1) rubocop (>= 0.70.0) ruby-progressbar (1.10.1) ruby_dep (1.5.0) rubyzip (1.3.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.0.7) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) shoulda-context (2.0.0) shoulda-matchers (4.3.0) activesupport (>= 4.2.0) snowglobe (0.3.0) spring (2.1.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.13) thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (1.2.7) thread_safe (~> 0.1) unicode-display_width (1.6.1) warnings_logger (0.1.0) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS ruby DEPENDENCIES appraisal (~> 2.1) bcrypt (~> 3.1.7) bundler (~> 1.0) capybara (~> 2.13) jbuilder (~> 2.5) listen (>= 3.0.5, < 3.2) m minitest (~> 5.0) minitest-reporters mry pry (~> 0.12.0) pry-byebug (~> 3.6.0) puma (~> 3.7) rails (~> 5.1.6) rails-controller-testing (>= 1.0.1) rubocop (= 0.71.0) rubocop-rails rubyzip (~> 1.3.0) sass-rails (~> 5.0) selenium-webdriver shoulda! snowglobe (>= 0.3.0) spring spring-commands-rspec spring-watcher-listen (~> 2.0.0) sqlite3 (~> 1.3.6) turbolinks (~> 5) warnings_logger BUNDLED WITH 1.17.3 shoulda-4.0.0/gemfiles/rails_6_0.gemfile.lock0000644000004100000410000001562013701111011021022 0ustar www-datawww-dataPATH remote: .. specs: shoulda (4.0.0) shoulda-context (~> 2.0) shoulda-matchers (~> 4.0) GEM remote: https://rubygems.org/ specs: actioncable (6.0.2.2) actionpack (= 6.0.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) actionmailbox (6.0.2.2) actionpack (= 6.0.2.2) activejob (= 6.0.2.2) activerecord (= 6.0.2.2) activestorage (= 6.0.2.2) activesupport (= 6.0.2.2) mail (>= 2.7.1) actionmailer (6.0.2.2) actionpack (= 6.0.2.2) actionview (= 6.0.2.2) activejob (= 6.0.2.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) actionpack (6.0.2.2) actionview (= 6.0.2.2) activesupport (= 6.0.2.2) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actiontext (6.0.2.2) actionpack (= 6.0.2.2) activerecord (= 6.0.2.2) activestorage (= 6.0.2.2) activesupport (= 6.0.2.2) nokogiri (>= 1.8.5) actionview (6.0.2.2) activesupport (= 6.0.2.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) activejob (6.0.2.2) activesupport (= 6.0.2.2) globalid (>= 0.3.6) activemodel (6.0.2.2) activesupport (= 6.0.2.2) activerecord (6.0.2.2) activemodel (= 6.0.2.2) activesupport (= 6.0.2.2) activestorage (6.0.2.2) actionpack (= 6.0.2.2) activejob (= 6.0.2.2) activerecord (= 6.0.2.2) marcel (~> 0.3.1) activesupport (6.0.2.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) appraisal (2.2.0) bundler rake thor (>= 0.14.0) ast (2.4.0) bcrypt (3.1.13) bootsnap (1.4.6) msgpack (~> 1.0) builder (3.2.4) byebug (10.0.2) capybara (3.32.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) childprocess (3.0.0) coderay (1.1.2) concurrent-ruby (1.1.6) crass (1.0.6) erubi (1.9.0) ffi (1.12.2) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.8.2) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) jbuilder (2.10.0) activesupport (>= 5.0.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) m (1.5.1) method_source (>= 0.6.7) rake (>= 0.9.2.2) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) method_source (0.9.2) mimemagic (0.3.4) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.0) minitest-reporters (1.4.2) ansi builder minitest (>= 5.0) ruby-progressbar mry (0.78.0.0) rubocop (>= 0.41.0) msgpack (1.3.3) nio4r (2.5.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) parallel (1.19.1) parser (2.7.1.0) ast (~> 2.4.0) pg (1.2.3) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-byebug (3.6.0) byebug (~> 10.0) pry (~> 0.10) public_suffix (4.0.3) puma (4.3.3) nio4r (~> 2.0) rack (2.2.2) rack-proxy (0.6.5) rack rack-test (1.1.0) rack (>= 1.0, < 3) rails (6.0.2.2) actioncable (= 6.0.2.2) actionmailbox (= 6.0.2.2) actionmailer (= 6.0.2.2) actionpack (= 6.0.2.2) actiontext (= 6.0.2.2) actionview (= 6.0.2.2) activejob (= 6.0.2.2) activemodel (= 6.0.2.2) activerecord (= 6.0.2.2) activestorage (= 6.0.2.2) activesupport (= 6.0.2.2) bundler (>= 1.3.0) railties (= 6.0.2.2) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) actionview (>= 5.0.1.x) activesupport (>= 5.0.1.x) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) railties (6.0.2.2) actionpack (= 6.0.2.2) activesupport (= 6.0.2.2) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) rainbow (3.0.0) rake (13.0.1) rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (1.7.0) rubocop (0.71.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) rubocop-rails (2.0.1) rack (>= 1.1) rubocop (>= 0.70.0) ruby-progressbar (1.10.1) ruby_dep (1.5.0) rubyzip (1.3.0) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) sassc (2.2.1) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) sassc (>= 2.0) sprockets (> 3.0) sprockets-rails tilt selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) shoulda-context (2.0.0) shoulda-matchers (4.3.0) activesupport (>= 4.2.0) snowglobe (0.3.0) spring (2.1.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) sprockets (4.0.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.4.2) thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (1.2.7) thread_safe (~> 0.1) unicode-display_width (1.6.1) warnings_logger (0.1.0) webdrivers (4.2.0) nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (>= 3.0, < 4.0) webpacker (4.2.2) activesupport (>= 4.2) rack-proxy (>= 0.6.1) railties (>= 4.2) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.3.0) PLATFORMS ruby DEPENDENCIES appraisal (~> 2.1) bcrypt (~> 3.1.7) bootsnap (>= 1.4.2) bundler (~> 1.0) capybara (>= 2.15) jbuilder (~> 2.7) listen (>= 3.0.5, < 3.2) m minitest (~> 5.0) minitest-reporters mry pg (~> 1.1) pry (~> 0.12.0) pry-byebug (~> 3.6.0) puma (~> 4.1) rails (~> 6.0.2) rails-controller-testing (>= 1.0.4) rubocop (= 0.71.0) rubocop-rails rubyzip (~> 1.3.0) sass-rails (>= 6) selenium-webdriver shoulda! snowglobe (>= 0.3.0) spring spring-commands-rspec spring-watcher-listen (~> 2.0.0) sqlite3 (~> 1.4.0) turbolinks (~> 5) warnings_logger webdrivers webpacker (~> 4.0) BUNDLED WITH 1.17.3 shoulda-4.0.0/gemfiles/rails_5_0.gemfile0000644000004100000410000000136313701111011020071 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.1" gem "bundler", "~> 1.0" gem "m" gem "minitest", "~> 5.0" gem "minitest-reporters" gem "mry" gem "pry", "~> 0.12.0" gem "pry-byebug", "~> 3.6.0" gem "rubocop", "0.71.0", require: false gem "rubocop-rails", require: false gem "snowglobe", ">= 0.3.0" gem "warnings_logger" gem "sqlite3", "~> 1.3.6" gem "rubyzip", "~> 1.3.0" gem "spring" gem "spring-commands-rspec" gem "rails", "~> 5.0.7" gem "rails-controller-testing", ">= 1.0.1" gem "puma", "~> 3.0" gem "sass-rails", "~> 5.0" gem "jquery-rails" gem "turbolinks", "~> 5" gem "jbuilder", "~> 2.5" gem "bcrypt", "~> 3.1.7" gem "listen", "~> 3.0.5" gem "spring-watcher-listen", "~> 2.0.0" gemspec path: "../" shoulda-4.0.0/gemfiles/rails_5_1.gemfile0000644000004100000410000000143413701111011020071 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.1" gem "bundler", "~> 1.0" gem "m" gem "minitest", "~> 5.0" gem "minitest-reporters" gem "mry" gem "pry", "~> 0.12.0" gem "pry-byebug", "~> 3.6.0" gem "rubocop", "0.71.0", require: false gem "rubocop-rails", require: false gem "snowglobe", ">= 0.3.0" gem "warnings_logger" gem "sqlite3", "~> 1.3.6" gem "rubyzip", "~> 1.3.0" gem "spring" gem "spring-commands-rspec" gem "rails", "~> 5.1.6" gem "rails-controller-testing", ">= 1.0.1" gem "puma", "~> 3.7" gem "sass-rails", "~> 5.0" gem "turbolinks", "~> 5" gem "jbuilder", "~> 2.5" gem "bcrypt", "~> 3.1.7" gem "capybara", "~> 2.13" gem "selenium-webdriver" gem "listen", ">= 3.0.5", "< 3.2" gem "spring-watcher-listen", "~> 2.0.0" gemspec path: "../" shoulda-4.0.0/gemfiles/rails_6_0.gemfile0000644000004100000410000000162413701111011020072 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.1" gem "bundler", "~> 1.0" gem "m" gem "minitest", "~> 5.0" gem "minitest-reporters" gem "mry" gem "pry", "~> 0.12.0" gem "pry-byebug", "~> 3.6.0" gem "rubocop", "0.71.0", require: false gem "rubocop-rails", require: false gem "snowglobe", ">= 0.3.0" gem "warnings_logger" gem "sqlite3", "~> 1.4.0" gem "rubyzip", "~> 1.3.0" gem "spring" gem "spring-commands-rspec" gem "rails", "~> 6.0.2" gem "puma", "~> 4.1" gem "sass-rails", ">= 6" gem "webpacker", "~> 4.0" gem "turbolinks", "~> 5" gem "jbuilder", "~> 2.7" gem "bcrypt", "~> 3.1.7" gem "bootsnap", ">= 1.4.2", require: false gem "listen", ">= 3.0.5", "< 3.2" gem "spring-watcher-listen", "~> 2.0.0" gem "capybara", ">= 2.15" gem "selenium-webdriver" gem "webdrivers" gem "rails-controller-testing", ">= 1.0.4" gem "pg", "~> 1.1", platform: :ruby gemspec path: "../" shoulda-4.0.0/gemfiles/rails_5_0.gemfile.lock0000644000004100000410000001275013701111011021022 0ustar www-datawww-dataPATH remote: .. specs: shoulda (4.0.0) shoulda-context (~> 2.0) shoulda-matchers (~> 4.0) GEM remote: https://rubygems.org/ specs: actioncable (5.0.7.2) actionpack (= 5.0.7.2) nio4r (>= 1.2, < 3.0) websocket-driver (~> 0.6.1) actionmailer (5.0.7.2) actionpack (= 5.0.7.2) actionview (= 5.0.7.2) activejob (= 5.0.7.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) actionpack (5.0.7.2) actionview (= 5.0.7.2) activesupport (= 5.0.7.2) rack (~> 2.0) rack-test (~> 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (5.0.7.2) activesupport (= 5.0.7.2) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) activejob (5.0.7.2) activesupport (= 5.0.7.2) globalid (>= 0.3.6) activemodel (5.0.7.2) activesupport (= 5.0.7.2) activerecord (5.0.7.2) activemodel (= 5.0.7.2) activesupport (= 5.0.7.2) arel (~> 7.0) activesupport (5.0.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) ansi (1.5.0) appraisal (2.2.0) bundler rake thor (>= 0.14.0) arel (7.1.4) ast (2.4.0) bcrypt (3.1.13) builder (3.2.4) byebug (10.0.2) coderay (1.1.2) concurrent-ruby (1.1.6) crass (1.0.6) erubis (2.7.0) ffi (1.12.2) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.8.2) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) jbuilder (2.10.0) activesupport (>= 5.0.0) jquery-rails (4.3.5) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) m (1.5.1) method_source (>= 0.6.7) rake (>= 0.9.2.2) mail (2.7.1) mini_mime (>= 0.1.1) method_source (0.9.2) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.0) minitest-reporters (1.4.2) ansi builder minitest (>= 5.0) ruby-progressbar mry (0.78.0.0) rubocop (>= 0.41.0) nio4r (2.5.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) parallel (1.19.1) parser (2.7.1.0) ast (~> 2.4.0) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-byebug (3.6.0) byebug (~> 10.0) pry (~> 0.10) puma (3.12.4) rack (2.2.2) rack-test (0.6.3) rack (>= 1.0) rails (5.0.7.2) actioncable (= 5.0.7.2) actionmailer (= 5.0.7.2) actionpack (= 5.0.7.2) actionview (= 5.0.7.2) activejob (= 5.0.7.2) activemodel (= 5.0.7.2) activerecord (= 5.0.7.2) activesupport (= 5.0.7.2) bundler (>= 1.3.0) railties (= 5.0.7.2) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) actionview (>= 5.0.1.x) activesupport (>= 5.0.1.x) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) railties (5.0.7.2) actionpack (= 5.0.7.2) activesupport (= 5.0.7.2) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (3.0.0) rake (13.0.1) rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) rubocop (0.71.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) rubocop-rails (2.0.1) rack (>= 1.1) rubocop (>= 0.70.0) ruby-progressbar (1.10.1) rubyzip (1.3.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.0.7) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) shoulda-context (2.0.0) shoulda-matchers (4.3.0) activesupport (>= 4.2.0) snowglobe (0.3.0) spring (2.1.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.13) thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (1.2.7) thread_safe (~> 0.1) unicode-display_width (1.6.1) warnings_logger (0.1.0) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) PLATFORMS ruby DEPENDENCIES appraisal (~> 2.1) bcrypt (~> 3.1.7) bundler (~> 1.0) jbuilder (~> 2.5) jquery-rails listen (~> 3.0.5) m minitest (~> 5.0) minitest-reporters mry pry (~> 0.12.0) pry-byebug (~> 3.6.0) puma (~> 3.0) rails (~> 5.0.7) rails-controller-testing (>= 1.0.1) rubocop (= 0.71.0) rubocop-rails rubyzip (~> 1.3.0) sass-rails (~> 5.0) shoulda! snowglobe (>= 0.3.0) spring spring-commands-rspec spring-watcher-listen (~> 2.0.0) sqlite3 (~> 1.3.6) turbolinks (~> 5) warnings_logger BUNDLED WITH 1.17.3 shoulda-4.0.0/gemfiles/rails_4_2.gemfile.lock0000644000004100000410000001327113701111011021022 0ustar www-datawww-dataPATH remote: .. specs: shoulda (4.0.0) shoulda-context (~> 2.0) shoulda-matchers (~> 4.0) GEM remote: https://rubygems.org/ specs: actionmailer (4.2.11.1) actionpack (= 4.2.11.1) actionview (= 4.2.11.1) activejob (= 4.2.11.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) actionpack (4.2.11.1) actionview (= 4.2.11.1) activesupport (= 4.2.11.1) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (4.2.11.1) activesupport (= 4.2.11.1) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.3) activejob (4.2.11.1) activesupport (= 4.2.11.1) globalid (>= 0.3.0) activemodel (4.2.11.1) activesupport (= 4.2.11.1) builder (~> 3.1) activerecord (4.2.11.1) activemodel (= 4.2.11.1) activesupport (= 4.2.11.1) arel (~> 6.0) activeresource (4.0.0) activemodel (~> 4.0) activesupport (~> 4.0) rails-observers (~> 0.1.1) activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) ansi (1.5.0) appraisal (2.2.0) bundler rake thor (>= 0.14.0) arel (6.0.4) ast (2.4.0) bcrypt (3.1.13) builder (3.2.4) byebug (10.0.2) coderay (1.1.2) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) concurrent-ruby (1.1.6) crass (1.0.6) erubis (2.7.0) execjs (2.7.0) ffi (1.12.2) globalid (0.4.2) activesupport (>= 4.2.0) i18n (0.9.5) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) jbuilder (2.9.1) activesupport (>= 4.2.0) jquery-rails (4.3.5) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.6) loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) m (1.5.1) method_source (>= 0.6.7) rake (>= 0.9.2.2) mail (2.7.1) mini_mime (>= 0.1.1) method_source (0.9.2) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.0) minitest-reporters (1.4.2) ansi builder minitest (>= 5.0) ruby-progressbar mry (0.78.0.0) rubocop (>= 0.41.0) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) parallel (1.19.1) parser (2.7.1.0) ast (~> 2.4.0) protected_attributes (1.0.9) activemodel (>= 4.0.1, < 5.0) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-byebug (3.6.0) byebug (~> 10.0) pry (~> 0.10) rack (1.6.13) rack-test (0.6.3) rack (>= 1.0) rails (4.2.11.1) actionmailer (= 4.2.11.1) actionpack (= 4.2.11.1) actionview (= 4.2.11.1) activejob (= 4.2.11.1) activemodel (= 4.2.11.1) activerecord (= 4.2.11.1) activesupport (= 4.2.11.1) bundler (>= 1.3.0, < 2.0) railties (= 4.2.11.1) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) rails-dom-testing (1.0.9) activesupport (>= 4.2.0, < 5.0) nokogiri (~> 1.6) rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.3.0) loofah (~> 2.3) rails-observers (0.1.5) activemodel (>= 4.0) railties (4.2.11.1) actionpack (= 4.2.11.1) activesupport (= 4.2.11.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (3.0.0) rake (13.0.1) rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) rdoc (4.3.0) rubocop (0.71.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) rubocop-rails (2.0.1) rack (>= 1.1) rubocop (>= 0.70.0) ruby-progressbar (1.10.1) rubyzip (1.3.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.0.7) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) shoulda-context (2.0.0) shoulda-matchers (4.3.0) activesupport (>= 4.2.0) snowglobe (0.3.0) spring (2.1.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.13) thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (1.2.7) thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicode-display_width (1.6.1) warnings_logger (0.1.0) PLATFORMS ruby DEPENDENCIES activeresource (= 4.0.0) appraisal (~> 2.1) bcrypt (~> 3.1.7) bundler (~> 1.0) coffee-rails (~> 4.1.0) jbuilder (~> 2.0) jquery-rails json (~> 1.4) m minitest (~> 5.0) minitest-reporters mry protected_attributes (~> 1.0.6) pry (~> 0.12.0) pry-byebug (~> 3.6.0) rails (~> 4.2.10) rubocop (= 0.71.0) rubocop-rails rubyzip (~> 1.3.0) sass-rails (~> 5.0) sdoc (~> 0.4.0) shoulda! snowglobe (>= 0.3.0) spring spring-commands-rspec sqlite3 (~> 1.3.6) turbolinks uglifier (>= 1.3.0) warnings_logger BUNDLED WITH 1.17.3 shoulda-4.0.0/CHANGELOG.md0000644000004100000410000000065413701111011015002 0ustar www-datawww-data# Changelog ## 4.0.0 (2020-06-13) * `shoulda` now brings in `shoulda-context` 2.0.0, which adds compatibility for Ruby 2.7, Rails 6.0, and shoulda-matchers 4.0! Note that there are some backward incompatible changes, so please see the [changelog entry][shoulda-context-2-0-0] for this release to learn more. [shoulda-context-2-0-0]: https://github.com/thoughtbot/shoulda-context/blob/master/CHANGELOG.md#200-2020-06-13 shoulda-4.0.0/.rubocop.yml0000644000004100000410000000767013701111011015450 0ustar www-datawww-dataAllCops: TargetRubyVersion: 2.4 Layout/ParameterAlignment: EnforcedStyle: with_fixed_indentation Layout/ConditionPosition: Enabled: false Layout/DotPosition: EnforcedStyle: trailing Layout/HeredocIndentation: Enabled: false Layout/MultilineMethodCallIndentation: EnforcedStyle: indented Lint/AmbiguousOperator: Enabled: false Lint/AmbiguousRegexpLiteral: Enabled: false Lint/AssignmentInCondition: Enabled: false Lint/DeprecatedClassMethods: Enabled: false Lint/ElseLayout: Enabled: false Lint/SuppressedException: Enabled: false Lint/LiteralInInterpolation: Enabled: false Lint/Loop: Enabled: false Lint/ParenthesesAsGroupedExpression: Enabled: false Lint/RequireParentheses: Enabled: false Lint/UnderscorePrefixedVariableName: Enabled: false Lint/Void: Enabled: false Metrics/BlockLength: Enabled: false Metrics/ClassLength: Enabled: false Metrics/LineLength: IgnoredPatterns: - "^[ ]*describe.+$" - "^[ ]*context.+$" - "^[ ]*shared_context.+$" - "^[ ]*shared_examples_for.+$" - "^[ ]*it.+$" - "^[ ]*'.+?' => '.+?',?$" - "^[ ]*\".+?\" => \".+?\",?$" - "^[ ]*.+?: .+?$" Metrics/MethodLength: Max: 30 Naming/AccessorMethodName: Enabled: false Naming/AsciiIdentifiers: Enabled: false Naming/BinaryOperatorParameterName: Enabled: false Style/ClassVars: Enabled: false Style/ColonMethodCall: Enabled: false Naming/FileName: Enabled: false Rails: Enabled: true Rails/Delegate: Enabled: false Rails/HttpPositionalArguments: Enabled: false Style/Alias: Enabled: false Style/ArrayJoin: Enabled: false Style/AsciiComments: Enabled: false Style/Attr: Enabled: false Style/CaseEquality: Enabled: false Style/CharacterLiteral: Enabled: false Style/ClassAndModuleChildren: Enabled: false Style/CollectionMethods: PreferredMethods: find: detect reduce: inject collect: map find_all: select Style/CommentAnnotation: Enabled: false Style/Documentation: Enabled: false Style/DoubleNegation: Enabled: false Style/EachWithObject: Enabled: false Style/EmptyLiteral: Enabled: false Style/Encoding: Enabled: false Style/EvenOdd: Enabled: false Lint/FlipFlop: Enabled: false Style/FormatString: Enabled: false Style/FrozenStringLiteralComment: Enabled: false Style/GlobalVars: Enabled: false Style/GuardClause: Enabled: false Style/IfUnlessModifier: Enabled: false Style/IfWithSemicolon: Enabled: false Style/InlineComment: Enabled: false Style/Lambda: Enabled: false Style/LambdaCall: Enabled: false Style/LineEndConcatenation: Enabled: false Style/MethodCalledOnDoEndBlock: Enabled: false Style/ModuleFunction: Enabled: false Style/NegatedIf: Enabled: false Style/NegatedWhile: Enabled: false Style/Next: Enabled: false Style/NilComparison: Enabled: false Style/Not: Enabled: false Style/NumericLiterals: Enabled: false Style/NumericPredicate: Enabled: false Style/OneLineConditional: Enabled: false Style/ParenthesesAroundCondition: Enabled: false Style/PercentLiteralDelimiters: Enabled: false Style/PerlBackrefs: Enabled: false Style/PreferredHashMethods: Enabled: false Style/Proc: Enabled: false Style/RaiseArgs: Enabled: false Style/RedundantParentheses: Enabled: false Style/RegexpLiteral: Enabled: false Style/SelfAssignment: Enabled: false Style/SignalException: Enabled: false Style/SingleLineBlockParams: Enabled: false Style/SingleLineMethods: Enabled: false Style/SpecialGlobalVars: Enabled: false Style/StringLiterals: EnforcedStyle: single_quotes Style/SymbolArray: Enabled: false Style/TrailingCommaInArguments: EnforcedStyleForMultiline: consistent_comma Style/TrailingCommaInArrayLiteral: EnforcedStyleForMultiline: consistent_comma Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: consistent_comma Style/TrivialAccessors: Enabled: false Style/WhenThen: Enabled: false Style/WhileUntilModifier: Enabled: false Style/WordArray: Enabled: false Style/VariableInterpolation: Enabled: false shoulda-4.0.0/Appraisals0000644000004100000410000000602013701111011015204 0ustar www-datawww-data# Note: All of the dependencies here were obtained by running `rails new` with # various versions of Rails and copying lines from the generated Gemfile. It's # best to keep the gems here in the same order as they're listed there so you # can compare them more easily. shared_rails_dependencies = proc do gem 'sqlite3', '~> 1.3.6' gem 'rubyzip', '~> 1.3.0' end shared_spring_dependencies = proc do gem 'spring' gem 'spring-commands-rspec' end shared_test_dependencies = proc do gem 'minitest-reporters' end shared_dependencies = proc do instance_eval(&shared_rails_dependencies) instance_eval(&shared_spring_dependencies) instance_eval(&shared_test_dependencies) end appraise 'rails_4_2' do instance_eval(&shared_dependencies) gem 'rails', '~> 4.2.10' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.1.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc gem 'bcrypt', '~> 3.1.7' # Other dependencies we use gem 'activeresource', '4.0.0' gem 'json', '~> 1.4' gem 'protected_attributes', '~> 1.0.6' end appraise 'rails_5_0' do instance_eval(&shared_dependencies) gem 'rails', '~> 5.0.7' gem 'rails-controller-testing', '>= 1.0.1' gem 'puma', '~> 3.0' gem 'sass-rails', '~> 5.0' gem 'jquery-rails' gem 'turbolinks', '~> 5' gem 'jbuilder', '~> 2.5' gem 'bcrypt', '~> 3.1.7' gem 'listen', '~> 3.0.5' gem 'spring-watcher-listen', '~> 2.0.0' end appraise 'rails_5_1' do instance_eval(&shared_dependencies) gem 'rails', '~> 5.1.6' gem 'rails-controller-testing', '>= 1.0.1' gem 'puma', '~> 3.7' gem 'sass-rails', '~> 5.0' gem 'turbolinks', '~> 5' gem 'jbuilder', '~> 2.5' gem 'bcrypt', '~> 3.1.7' gem 'capybara', '~> 2.13' gem 'selenium-webdriver' gem 'listen', '>= 3.0.5', '< 3.2' gem 'spring-watcher-listen', '~> 2.0.0' end appraise 'rails_5_2' do instance_eval(&shared_dependencies) gem 'rails', '~> 5.2.2' gem 'rails-controller-testing', '>= 1.0.1' gem 'puma', '~> 3.11' gem 'bootsnap', '>= 1.1.0', require: false gem 'sass-rails', '~> 5.0' gem 'turbolinks', '~> 5' gem 'jbuilder', '~> 2.5' gem 'bcrypt', '~> 3.1.7' gem 'capybara', '~> 3.1.1' gem 'selenium-webdriver' gem 'chromedriver-helper' gem 'listen', '>= 3.0.5', '< 3.2' gem 'spring-watcher-listen', '~> 2.0.0' end if Gem::Requirement.new('>= 2.5.0').satisfied_by?(Gem::Version.new(RUBY_VERSION)) appraise 'rails_6_0' do instance_eval(&shared_dependencies) gem 'rails', '~> 6.0.2' gem 'puma', '~> 4.1' gem 'sass-rails', '>= 6' gem 'webpacker', '~> 4.0' gem 'turbolinks', '~> 5' gem 'jbuilder', '~> 2.7' gem 'bcrypt', '~> 3.1.7' gem 'bootsnap', '>= 1.4.2', require: false gem 'listen', '>= 3.0.5', '< 3.2' gem 'spring-watcher-listen', '~> 2.0.0' gem 'capybara', '>= 2.15' gem 'selenium-webdriver' gem "sqlite3", "~> 1.4.0" gem 'webdrivers' # Other dependencies gem 'rails-controller-testing', '>= 1.0.4' gem 'pg', '~> 1.1', platform: :ruby end end shoulda-4.0.0/.gitignore0000644000004100000410000000015413701111011015154 0ustar www-datawww-data*.swo *.swp .DS_Store .byebug_history .bundle .svn/ Gemfile.lock coverage doc pkg tags test/*/log/*.log tmp shoulda-4.0.0/script/0000755000004100000410000000000013701111012014471 5ustar www-datawww-datashoulda-4.0.0/script/run_all_tests0000755000004100000410000000047413701111012017302 0ustar www-datawww-data#!/bin/bash set -euo pipefail SUPPORTED_VERSIONS=$(script/supported_ruby_versions) run-tests-for-version() { local version="$1" (export RBENV_VERSION=$version; bundle exec rake) } for version in $SUPPORTED_VERSIONS; do echo echo "*** Running tests for $version ***" run-tests-for-version $version done shoulda-4.0.0/script/update_gem_in_all_appraisals0000755000004100000410000000056013701111012022267 0ustar www-datawww-data#!/bin/bash set -euo pipefail SUPPORTED_VERSIONS=$(script/supported_ruby_versions) gem="$1" update-gem-for-version() { local version="$1" (export RBENV_VERSION=$version; bundle update "$gem"; bundle exec appraisal update "$gem") } for version in $SUPPORTED_VERSIONS; do echo echo "*** Updating $gem for $version ***" update-gem-for-version $version done shoulda-4.0.0/script/supported_ruby_versions0000755000004100000410000000030713701111012021435 0ustar www-datawww-data#!/usr/bin/env ruby require 'yaml' travis_config_path = File.expand_path('../../.travis.yml', __FILE__) travis_config = YAML.load_file(travis_config_path) puts travis_config.fetch('rvm').join(' ') shoulda-4.0.0/script/update_gems_in_all_appraisals0000755000004100000410000000056413701111012022456 0ustar www-datawww-data#!/bin/bash set -euo pipefail SUPPORTED_VERSIONS=$(script/supported_ruby_versions) update-gems-for-version() { local version="$1" (export RBENV_VERSION=$version; bundle update "${@:2}"; bundle exec appraisal update "${@:2}") } for version in $SUPPORTED_VERSIONS; do echo echo "*** Updating gems for $version ***" update-gems-for-version "$version" "$@" done shoulda-4.0.0/script/install_gems_in_all_appraisals0000755000004100000410000000053313701111012022636 0ustar www-datawww-data#!/bin/bash set -euo pipefail SUPPORTED_VERSIONS=$(script/supported_ruby_versions) install-gems-for-version() { local version="$1" (export RBENV_VERSION=$version; bundle && bundle exec appraisal install) } for version in $SUPPORTED_VERSIONS; do echo echo "*** Installing gems for $version ***" install-gems-for-version $version done shoulda-4.0.0/.autotest0000644000004100000410000000051713701111011015040 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-4.0.0/.hound.yml0000644000004100000410000000006213701111011015100 0ustar www-datawww-dataruby: enabled: true config_file: .rubocop.yml shoulda-4.0.0/Rakefile0000644000004100000410000000140013701111011014624 0ustar www-datawww-datarequire 'bundler/setup' require 'bundler/gem_tasks' require 'rake/testtask' require 'pry-byebug' require_relative 'test/support/current_bundle' Rake::TestTask.new do |t| t.libs << 'test' t.ruby_opts += ['-w'] t.pattern = 'test/**/*_test.rb' t.verbose = false end task :default do if Tests::CurrentBundle.instance.appraisal_in_use? Rake::Task['test'].invoke elsif ENV['CI'] exec 'appraisal install && appraisal rake --trace' else appraisal = Tests::CurrentBundle.instance.latest_appraisal exec "appraisal install && appraisal #{appraisal} rake --trace" end end namespace :appraisal do task :list do appraisals = Tests::CurrentBundle.instance.available_appraisals puts "Valid appraisals: #{appraisals.join(', ')}" end end shoulda-4.0.0/lib/0000755000004100000410000000000013701111011013732 5ustar www-datawww-datashoulda-4.0.0/lib/shoulda/0000755000004100000410000000000013701111011015371 5ustar www-datawww-datashoulda-4.0.0/lib/shoulda/version.rb0000644000004100000410000000005613701111011017404 0ustar www-datawww-datamodule Shoulda VERSION = '4.0.0'.freeze end shoulda-4.0.0/lib/shoulda.rb0000644000004100000410000000011713701111011015715 0ustar www-datawww-datarequire 'shoulda/version' require 'shoulda/matchers' require 'shoulda/context' shoulda-4.0.0/CONTRIBUTING.md0000644000004100000410000000275013701111011015421 0ustar www-datawww-dataWe love pull requests from everyone. By participating in this project, you agree to abide by the thoughtbot [code of conduct]. [code of conduct]: https://thoughtbot.com/open-source-code-of-conduct 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-4.0.0/Gemfile0000644000004100000410000000053213701111011014457 0ustar www-datawww-datasource 'https://rubygems.org' gemspec gem 'appraisal', '~> 2.1' gem 'bundler', '~> 1.0' gem 'm' gem 'minitest', '~> 5.0' gem 'minitest-reporters', '~> 1.0' gem 'mry' gem 'pry', '~> 0.12.0' gem 'pry-byebug', '~> 3.6.0' gem 'rubocop', '0.71.0', require: false gem 'rubocop-rails', require: false gem 'snowglobe', '>= 0.3.0' gem 'warnings_logger' shoulda-4.0.0/.ruby-version0000644000004100000410000000000613701111011015625 0ustar www-datawww-data2.7.1 shoulda-4.0.0/MIT-LICENSE0000644000004100000410000000212013701111011014613 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-4.0.0/shoulda.gemspec0000644000004100000410000000156613701111012016201 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 = 'support@thoughtbot.com' s.homepage = 'https://github.com/thoughtbot/shoulda' s.summary = 'Making tests easy on the fingers and eyes' s.description = 'Making tests easy on the fingers and eyes' s.license = '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 do |file| File.basename(file) end s.require_paths = ['lib'] s.add_dependency('shoulda-context', '~> 2.0') s.add_dependency('shoulda-matchers', '~> 4.0') end