Remove most docs for ignoring_interference_by_writer

Since `ignoring_interference_by_writer` is on by default now, we don't
need to explicitly document it (unless someone wants to turn it off, but
that's unlikely).

[ci skip]
This commit is contained in:
Elliot Winkler 2016-01-10 23:19:47 -07:00
parent 5aa15098bb
commit 663c2f2c4d
7 changed files with 0 additions and 238 deletions

View File

@ -70,39 +70,6 @@ module Shoulda
# with_message("there shall be peace on Earth")
# end
#
# ##### ignoring_interference_by_writer
#
# Use `ignoring_interference_by_writer` when the attribute you're testing
# changes incoming values. This qualifier will instruct the matcher to
# suppress raising an AttributeValueChangedError, as long as changing the
# doesn't also change the outcome of the test and causes it to fail. See
# the documentation for `allow_value` for more information on this.
#
# class PowerHungryCountry
# include ActiveModel::Model
# attr_accessor :nuclear_weapons
#
# validates_absence_of :nuclear_weapons
#
# def nuclear_weapons=(value)
# @nuclear_weapons = value + [:hidden_weapon]
# end
# end
#
# # RSpec
# describe PowerHungryCountry do
# it do
# should validate_absence_of(:nuclear_weapons).
# ignoring_interference_by_writer
# end
# end
#
# # Minitest (Shoulda)
# class PowerHungryCountryTest < ActiveSupport::TestCase
# should validate_absence_of(:nuclear_weapons).
# ignoring_interference_by_writer
# end
#
# @return [ValidateAbsenceOfMatcher}
#
def validate_absence_of(attr)

View File

@ -73,39 +73,6 @@ module Shoulda
# with_message('You must accept the terms of service')
# end
#
# ##### ignoring_interference_by_writer
#
# Use `ignoring_interference_by_writer` when the attribute you're testing
# changes incoming values. This qualifier will instruct the matcher to
# suppress raising an AttributeValueChangedError, as long as changing the
# doesn't also change the outcome of the test and cause it to fail. See
# the documentation for `allow_value` for more information on this.
#
# class Registration
# include ActiveModel::Model
# attr_accessor :terms_of_service
#
# validates_acceptance_of :terms_of_service
#
# def terms_of_service=(value)
# @terms_of_service = value || 'something else'
# end
# end
#
# # RSpec
# describe Registration do
# it do
# should validate_acceptance_of(:terms_of_service).
# ignoring_interference_by_writer
# end
# end
#
# # Minitest (Shoulda)
# class RegistrationTest < ActiveSupport::TestCase
# should validate_acceptance_of(:terms_of_service).
# ignoring_interference_by_writer
# end
#
# @return [ValidateAcceptanceOfMatcher]
#
def validate_acceptance_of(attr)

View File

@ -112,41 +112,6 @@ module Shoulda
# with_message('You chose a puny weapon')
# end
#
# ##### ignoring_interference_by_writer
#
# Use `ignoring_interference_by_writer` when the attribute you're testing
# changes incoming values. This qualifier will instruct the matcher to
# suppress raising an AttributeValueChangedError, as long as changing the
# doesn't also change the outcome of the test and cause it to fail. See
# the documentation for `allow_value` for more information on this.
#
# class Game < ActiveRecord::Base
# include ActiveModel::Model
# attr_accessor :weapon
#
# validates_exclusion_of :weapon
#
# def weapon=(value)
# @weapon = value.gsub(' ', '')
# end
# end
#
# # RSpec
# describe Game do
# it do
# should validate_exclusion_of(:weapon).
# in_array(['pistol', 'paintball gun', 'stick']).
# ignoring_interference_by_writer
# end
# end
#
# # Minitest (Shoulda)
# class GameTest < ActiveSupport::TestCase
# should validate_exclusion_of(:weapon).
# in_array(['pistol', 'paintball gun', 'stick']).
# ignoring_interference_by_writer
# end
#
# @return [ValidateExclusionOfMatcher]
#
def validate_exclusion_of(attr)

View File

@ -259,42 +259,6 @@ module Shoulda
# allow_blank
# end
#
# ##### ignoring_interference_by_writer
#
# Use `ignoring_interference_by_writer` when the attribute you're testing
# changes incoming values. This qualifier will instruct the matcher to
# suppress raising an AttributeValueChangedError, as long as changing the
# doesn't also change the outcome of the test and cause it to fail. See
# the documentation for `allow_value` for more information on this.
#
# class Issue
# include ActiveModel::Model
# attr_accessor :state
#
# validates_inclusion_of :state,
# in: ['open', 'resolved', 'unresolved']
#
# def state=(value)
# @state = 'open'
# end
# end
#
# # RSpec
# describe Issue do
# it do
# should validate_inclusion_of(:state).
# in_array(['open', 'resolved', 'unresolved']).
# ignoring_interference_by_writer
# end
# end
#
# # Minitest (Shoulda)
# class IssueTest < ActiveSupport::TestCase
# should validate_inclusion_of(:state).
# in_array(['open', 'resolved', 'unresolved']).
# ignoring_interference_by_writer
# end
#
# @return [ValidateInclusionOfMatcher]
#
def validate_inclusion_of(attr)

View File

@ -216,41 +216,6 @@ module Shoulda
# with_long_message('Secret key must be less than 100 characters')
# end
#
# ##### ignoring_interference_by_writer
#
# Use `ignoring_interference_by_writer` when the attribute you're testing
# changes incoming values. This qualifier will instruct the matcher to
# suppress raising an AttributeValueChangedError, as long as changing the
# doesn't also change the outcome of the test and cause it to fail. See
# the documentation for `allow_value` for more information on this.
#
# class User
# include ActiveModel::Model
# attr_accessor :password
#
# validates_length_of :password, minimum: 10
#
# def password=(value)
# @password = value.upcase
# end
# end
#
# # RSpec
# describe User do
# it do
# should validate_length_of(:password).
# is_at_least(10).
# ignoring_interference_by_writer
# end
# end
#
# # Minitest (Shoulda)
# class UserTest < ActiveSupport::TestCase
# should validate_length_of(:password).
# is_at_least(10).
# ignoring_interference_by_writer
# end
#
# @return [ValidateLengthOfMatcher]
#
def validate_length_of(attr)

View File

@ -296,39 +296,6 @@ module Shoulda
# should validate_numericality_of(:age).allow_nil
# end
#
# ##### ignoring_interference_by_writer
#
# Use `ignoring_interference_by_writer` when the attribute you're testing
# changes incoming values. This qualifier will instruct the matcher to
# suppress raising an AttributeValueChangedError, as long as changing the
# doesn't also change the outcome of the test and cause it to fail. See
# the documentation for `allow_value` for more information on this.
#
# Here, `gpa` is an integer column, so it will typecast all values to
# integers. We need to use `ignoring_interference_by_writer` because the
# `only_integer` qualifier will attempt to set `gpa` to a float and assert
# that it makes the record invalid.
#
# class Person < ActiveRecord::Base
# validates_numericality_of :gpa, only_integer: true
# end
#
# # RSpec
# describe Person do
# it do
# should validate_numericality_of(:gpa).
# only_integer.
# ignoring_interference_by_writer
# end
# end
#
# # Minitest (Shoulda)
# class PersonTest < ActiveSupport::TestCase
# should validate_numericality_of(:gpa).
# only_integer.
# ignoring_interference_by_writer
# end
#
# @return [ValidateNumericalityOfMatcher]
#
def validate_numericality_of(attr)

View File

@ -103,39 +103,6 @@ module Shoulda
# with_message('Robot has no legs')
# end
#
# ##### ignoring_interference_by_writer
#
# Use `ignoring_interference_by_writer` when the attribute you're testing
# changes incoming values. This qualifier will instruct the matcher to
# suppress raising an AttributeValueChangedError, as long as changing the
# doesn't also change the outcome of the test and cause it to fail. See
# the documentation for `allow_value` for more information on this.
#
# class Robot
# include ActiveModel::Model
# attr_accessor :name
#
# validates_presence_of :name
#
# def name=(name)
# @name = name.to_s
# end
# end
#
# # RSpec
# describe Robot do
# it do
# should validate_presence_of(:name).
# ignoring_interference_by_writer
# end
# end
#
# # Minitest (Shoulda)
# class RobotTest < ActiveSupport::TestCase
# should validate_presence_of(:name).
# ignoring_interference_by_writer
# end
#
# @return [ValidatePresenceOfMatcher]
#
def validate_presence_of(attr)