なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2014/08/29)

2014/08/29分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionpack/CHANGELOG.md


No transaction for a test that creates fixtures in the test body

activerecord/test/cases/fixtures_test.rbの修正です。

use_transactional_fixtures = falseを追加しています。

元々テストの後処理で手でデータの削除処理を行っていたようです。 fixtureのトランザクション設定無しで良いんですね。むう。データ何処で消してるんだろう。


Avoid using heredoc for user warnings

warningの出力にheredocを使用していたのを止めて、普通にStringとして扱うよう修正しています。

heredocだとカラムの幅に関係なく、行毎に改行が入ってしまい、 ユーザが読みづらいのでは無いか、という事で使用を止めたとの事です。


Merge pull request #16637 from Agis-/redirect-with-constraint-route

actionpack/lib/action_dispatch/routing/mapper.rbの修正です。

constraintsをredirectと一緒に使用してたい際に、正常に動作していなかったバグを修正しています。

テストケースから抜粋。

get 'hi', to: redirect("/foo"), constraints: ::TestRoutingMapper::GrumpyRestrictor

4.2.0で起きてたリグレッションとの事です。


Demodulize ActiveRecord::MigratorTest

activerecord/test/cases/migrator_test.rbの修正です。

module ActiveRecordでテスト全体をくくっていたのを、moduleを削除しています。


Reset ActiveRecord::Migration.verbose to the value before

activerecord/test/cases/migration_test.rbactiverecord/test/cases/migrator_test.rbの修正です。

元々のActiveRecord::Migration.verboseの値を保持し、後処理で元の値に戻すよう修正しています。


No tests are dealing with ActiveRecord::Migration.message_count here anymore

activerecord/test/cases/migration_test.rbの修正です。

不要なActiveRecord::Migration.message_countを削除しています。


MigrationTest doesn't need to be verbose anymore

activerecord/test/cases/migration_test.rbの修正です。

テストの中でActiveRecord::Migration.verboseにtrueを設定していたのをfalseを設定するよう修正しています。

MigrationTestdでは詳細は不要な為のようです。


Silence another test that runs migrations

activerecord/test/cases/invertible_migration_test.rbの修正です。

ActiveRecord::Migration.verboseにfalseを設定するよう修正しています。


Bring original puts back after finishing tests

activerecord/test/cases/migrator_test.rbの修正です。

テストの中でputsメソッドをオーバーライドしていたのを、テスト終了時に元のメソッドが呼び出されるよう対応しています。


Reset ActiveRecord::Migration.message_count counter before start testing

activerecord/test/cases/migrator_test.rbの修正です。

テストの中でActiveRecord::Migration.message_countの値をリセットしていたのを、setup処理内で行うよう修正しています。


[ci skip] Fix example code of ActiveRecord::FixtureSet.context_class

activerecord/lib/active_record/fixtures.rbのdocの修正です。

ActiveRecord::FixtureSet.context_classのexampleに誤りがあったのを修正しています。


Don't rescue IPAddr::InvalidAddressError

actionpack/lib/action_dispatch/middleware/remote_ip.rbの修正です。

ips_fromメソッドでArgumentError, IPAddr::InvalidAddressErrorをrescueしていたのから、IPAddr::InvalidAddressErrorを削除しています。

InvalidAddressErrorはRuby1.9.3には無いのでエラーになってしまっていたそうです。また、InvalidAddressErrorはArgumentErrorのサブクラスなので、ArgumentErrorをrescueしていれば問題ないとの事で、削除しています。


[ActiveJob] extract JobBuffer from helper

ActiveJobの修正です。

activejob/test/helper.rb内で定義していたJobBufferモジュールを別ファイルに切り出しています。


Don't test PostgreSQL implementation details

activerecord/test/cases/adapters/postgresql/explain_test.rbのテストの修正です。

explainについてのテストで、queryにEXPLAIN forが含まれていればテストとしては問題無いという事で、詳細なqueryを確認するテストを削除しています。


Some documentation fixes [ci skip]

ActiveJobのdocの修正です。

グラマーの修正を行っています。


Make test:isolated run without bundler for Action Mailer

actionmailer/test/message_delivery_test.rbの修正です。

単体でテストが動作出来るよう、gem 'activejob'を削除しています。


Avoid skipping Sidekiq tests on Rubinius

activejob/test/helper.rbの修正です。

TravisがRubinius 2.2.10がサポートした為、Rubiniusでもsidekiqのテストを行うよう修正しています。