Skip to content

Commit

Permalink
Replace ableist language
Browse files Browse the repository at this point in the history
The word "Crazy" has long been associated with mental illness. While
there may be other dictionary definitions, it's difficult for some of us
to separate the word from the stigmatization, gaslighting, and bullying
that often comes along with it.

This commit replaces instances of the word with various alternatives. I
find most of these more focused and descriptive than what we had before.
  • Loading branch information
composerinteralia committed Oct 6, 2021
1 parent 10c0b59 commit ccb3cb5
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions actionmailer/test/test_case_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ def test_deliveries_are_cleared_on_setup_and_teardown
end
end

class CrazyNameMailerTest < ActionMailer::TestCase
class ManuallySetNameMailerTest < ActionMailer::TestCase
tests TestTestMailer

def test_set_mailer_class_manual
assert_equal TestTestMailer, self.class.mailer_class
end
end

class CrazySymbolNameMailerTest < ActionMailer::TestCase
class ManuallySetSymbolNameMailerTest < ActionMailer::TestCase
tests :test_test_mailer

def test_set_mailer_class_manual_using_symbol
assert_equal TestTestMailer, self.class.mailer_class
end
end

class CrazyStringNameMailerTest < ActionMailer::TestCase
class ManuallySetStringNameMailerTest < ActionMailer::TestCase
tests "test_test_mailer"

def test_set_mailer_class_manual_using_string
Expand Down
6 changes: 3 additions & 3 deletions actionpack/test/controller/test_case_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1166,23 +1166,23 @@ def determine_class(name)
end
end

class CrazyNameTest < ActionController::TestCase
class ManuallySetNameTest < ActionController::TestCase
tests ContentController

def test_controller_class_can_be_set_manually_not_just_inferred
assert_equal ContentController, self.class.controller_class
end
end

class CrazySymbolNameTest < ActionController::TestCase
class ManuallySetSymbolNameTest < ActionController::TestCase
tests :content

def test_set_controller_class_using_symbol
assert_equal ContentController, self.class.controller_class
end
end

class CrazyStringNameTest < ActionController::TestCase
class ManuallySetStringNameTest < ActionController::TestCase
tests "content"

def test_set_controller_class_using_string
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/dispatch/request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ class RequestFormat < BaseRequestTest

assert_equal [ Mime[:html] ], request.formats

request = stub_request "HTTP_ACCEPT" => "koz-asked/something-crazy",
request = stub_request "HTTP_ACCEPT" => "koz-asked/something-wild",
"QUERY_STRING" => ""

assert_equal [ Mime[:html] ], request.formats
Expand Down
6 changes: 3 additions & 3 deletions actionview/test/template/test_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ def with_test_route_set
end
end

class CrazyHelperTest < ActionView::TestCase
class ManuallySetHelperTest < ActionView::TestCase
tests PeopleHelper

def test_helper_class_can_be_set_manually_not_just_inferred
assert_equal PeopleHelper, self.class.helper_class
end
end

class CrazySymbolHelperTest < ActionView::TestCase
class ManuallySetSymbolHelperTest < ActionView::TestCase
tests :people

def test_set_helper_class_using_symbol
assert_equal PeopleHelper, self.class.helper_class
end
end

class CrazyStringHelperTest < ActionView::TestCase
class ManuallySetStringHelperTest < ActionView::TestCase
tests "people"

def test_set_helper_class_using_string
Expand Down
2 changes: 1 addition & 1 deletion actionview/test/template/text_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_simple_format_included_in_isolation
def test_simple_format
assert_equal "<p></p>", simple_format(nil)

assert_equal "<p>crazy\n<br /> cross\n<br /> platform linebreaks</p>", simple_format("crazy\r\n cross\r platform linebreaks")
assert_equal "<p>ridiculous\n<br /> cross\n<br /> platform linebreaks</p>", simple_format("ridiculous\r\n cross\r platform linebreaks")
assert_equal "<p>A paragraph</p>\n\n<p>and another one!</p>", simple_format("A paragraph\n\nand another one!")
assert_equal "<p>A paragraph\n<br /> With a newline</p>", simple_format("A paragraph\n With a newline")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def construct_join_attributes(*records)
end
end

# Note: this does not capture all cases, for example it would be crazy to try to
# properly support stale-checking for nested associations.
# Note: this does not capture all cases, for example it would be impractical
# to try to properly support stale-checking for nested associations.
def stale_state
if through_reflection.belongs_to?
owner[through_reflection.foreign_key] && owner[through_reflection.foreign_key].to_s
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/cases/associations/eager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -679,15 +679,15 @@ def test_eager_with_has_many_and_limit_and_high_offset_and_multiple_array_condit
assert_queries(1) do
posts = Post.references(:authors, :comments).
merge(includes: [ :author, :comments ], limit: 2, offset: 10,
where: [ "authors.name = ? and comments.body = ?", "David", "go crazy" ]).to_a
where: [ "authors.name = ? and comments.body = ?", "David", "go wild" ]).to_a
assert_equal 0, posts.size
end
end

def test_eager_with_has_many_and_limit_and_high_offset_and_multiple_hash_conditions
assert_queries(1) do
posts = Post.all.merge!(includes: [ :author, :comments ], limit: 2, offset: 10,
where: { "authors.name" => "David", "comments.body" => "go crazy" }).to_a
where: { "authors.name" => "David", "comments.body" => "go wild" }).to_a
assert_equal 0, posts.size
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ def test_has_one_through_nonpreload_eager_loading_through_polymorphic
end

def test_has_one_through_nonpreload_eager_loading_through_polymorphic_with_more_than_one_through_record
Sponsor.new(sponsor_club: clubs(:crazy_club), sponsorable: members(:groucho)).save!
Sponsor.new(sponsor_club: clubs(:outrageous_club), sponsorable: members(:groucho)).save!
members = assert_queries(1) do
Member.all.merge!(includes: :sponsor_club, where: ["members.name = ?", "Groucho Marx"], order: "clubs.name DESC").to_a # force fallback
end
assert_equal 1, members.size
assert_not_nil assert_no_queries { members[0].sponsor_club }
assert_equal clubs(:crazy_club), members[0].sponsor_club
assert_equal clubs(:outrageous_club), members[0].sponsor_club
end

def test_uninitialized_has_one_through_should_return_nil_for_unsaved_record
Expand Down
12 changes: 6 additions & 6 deletions activerecord/test/cases/query_cache_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,15 @@ def test_clear_query_cache_is_called_on_all_legacy_connections
assert @topic

ActiveRecord::Base.connected_to(role: :writing) do
@topic.title = "It doesn't have to be crazy at work"
@topic.title = "Topic title"
@topic.save!
end

assert_equal "It doesn't have to be crazy at work", @topic.title
assert_equal "Topic title", @topic.title

ActiveRecord::Base.connected_to(role: :reading) do
@topic = Topic.first
assert_equal "It doesn't have to be crazy at work", @topic.title
assert_equal "Topic title", @topic.title
end
}

Expand Down Expand Up @@ -724,15 +724,15 @@ def test_clear_query_cache_is_called_on_all_connections
assert @topic

ActiveRecord::Base.connected_to(role: :writing) do
@topic.title = "It doesn't have to be crazy at work"
@topic.title = "Topic title"
@topic.save!
end

assert_equal "It doesn't have to be crazy at work", @topic.title
assert_equal "Topic title", @topic.title

ActiveRecord::Base.connected_to(role: :reading) do
@topic = Topic.first
assert_equal "It doesn't have to be crazy at work", @topic.title
assert_equal "Topic title", @topic.title
end
}

Expand Down
10 changes: 5 additions & 5 deletions activerecord/test/cases/quoting_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_quoted_timestamp_local
end
end

def test_quoted_timestamp_crazy
def test_quoted_timestamp_nonsense
with_timezone_config default: :asdfasdf do
t = Time.now.change(usec: 0)
assert_equal t.getlocal.to_s(:db), @quoter.quoted_date(t)
Expand Down Expand Up @@ -115,7 +115,7 @@ def test_quoted_time_dst_local
end
end

def test_quoted_time_crazy
def test_quoted_time_nonsense
with_timezone_config default: :asdfasdf do
t = Time.now.change(usec: 0)

Expand Down Expand Up @@ -185,10 +185,10 @@ def test_quoting_classes
assert_equal "'Object'", @quoter.quote(Object)
end

def test_crazy_object
crazy = Object.new
def test_quote_object_instance
object = Object.new
e = assert_raises(TypeError) do
@quoter.quote(crazy)
@quoter.quote(object)
end
assert_equal "can't quote Object", e.message
end
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/scoping/named_scoping_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def test_eager_default_scope_relations_are_remove
end

def test_subclass_merges_scopes_properly
assert_equal 1, SpecialComment.where(body: "go crazy").created.count
assert_equal 1, SpecialComment.where(body: "go wild").created.count
end

def test_model_class_should_respond_to_extending
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ def test_validate_uniqueness_with_scope_array

t = Topic.create("title" => "The earth is actually flat!")

r1 = t.replies.create "author_name" => "jeremy", "author_email_address" => "jeremy@rubyonrails.com", "title" => "You're crazy!", "content" => "Crazy reply"
r1 = t.replies.create "author_name" => "jeremy", "author_email_address" => "jeremy@rubyonrails.com", "title" => "You're joking!", "content" => "Silly reply"
assert r1.valid?, "Saving r1"

r2 = t.replies.create "author_name" => "jeremy", "author_email_address" => "jeremy@rubyonrails.com", "title" => "You're crazy!", "content" => "Crazy reply again..."
r2 = t.replies.create "author_name" => "jeremy", "author_email_address" => "jeremy@rubyonrails.com", "title" => "You're joking!", "content" => "Silly reply again..."
assert_not r2.valid?, "Saving r2. Double reply by same author."

r2.author_email_address = "jeremy_alt_email@rubyonrails.com"
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/fixtures/clubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ boring_club:
category_id: 1
moustache_club:
name: Moustache and Eyebrow Fancier Club
crazy_club:
outrageous_club:
name: Skull and bones
category_id: 2
2 changes: 1 addition & 1 deletion activerecord/test/fixtures/comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ check_eager_sti_on_associations2:
eager_other_comment1:
id: 11
post_id: 7
body: go crazy
body: go wild
type: SpecialComment

sub_special_comment:
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/fixtures/memberships.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ other_guys_membership:
favorite: false
type: CurrentMembership

blarpy_winkup_crazy_club:
blarpy_winkup_outrageous_club:
joined_on: <%= 4.weeks.ago.to_s(:db) %>
club: crazy_club
club: outrageous_club
member_id: 3
favorite: false
type: CurrentMembership
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/fixtures/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ boring_club_sponsor_for_groucho:
sponsor_club: boring_club
sponsorable_id: 2
sponsorable_type: Member
crazy_club_sponsor_for_groucho:
sponsor_club: crazy_club
outrageous_club_sponsor_for_groucho:
sponsor_club: outrageous_club
sponsorable_id: 3
sponsorable_type: Member
sponsor_for_author_david:
Expand Down
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/testing/isolation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def run_in_isolation(&blk)
module Subprocess
ORIG_ARGV = ARGV.dup unless defined?(ORIG_ARGV)

# Crazy H4X to get this working in windows / jruby with
# Complicated H4X to get this working in windows / jruby with
# no forking.
def run_in_isolation(&blk)
require "tempfile"
Expand Down
18 changes: 9 additions & 9 deletions activesupport/test/cache/behaviors/cache_store_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,15 @@ def test_race_condition_protection
end
end

def test_crazy_key_characters
crazy_key = "#/:*(<+=> )&$%@?;'\"\'`~-"
assert @cache.write(crazy_key, "1", raw: true)
assert_equal "1", @cache.read(crazy_key, raw: true)
assert_equal "1", @cache.fetch(crazy_key, raw: true)
assert @cache.delete(crazy_key)
assert_equal "2", @cache.fetch(crazy_key, raw: true) { "2" }
assert_equal 3, @cache.increment(crazy_key)
assert_equal 2, @cache.decrement(crazy_key)
def test_absurd_key_characters
absurd_key = "#/:*(<+=> )&$%@?;'\"\'`~-"
assert @cache.write(absurd_key, "1", raw: true)
assert_equal "1", @cache.read(absurd_key, raw: true)
assert_equal "1", @cache.fetch(absurd_key, raw: true)
assert @cache.delete(absurd_key)
assert_equal "2", @cache.fetch(absurd_key, raw: true) { "2" }
assert_equal 3, @cache.increment(absurd_key)
assert_equal 2, @cache.decrement(absurd_key)
end

def test_really_long_keys
Expand Down
4 changes: 2 additions & 2 deletions activesupport/test/callback_inheritance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ def setup
@update2 = Child.new("update", :closed).dispatch
end

def test_crazy_mix_on
def test_complex_mix_on
assert_equal %w(before1 update after2 after1), @update1.log
end

def test_crazy_mix_off
def test_complex_mix_off
assert_equal %w(before1 before2 update after2 after1), @update2.log
end
end
Expand Down

0 comments on commit ccb3cb5

Please sign in to comment.