diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2014-05-22 19:35:45 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2014-05-22 19:35:45 +0200 |
commit | 387a7d993573b1492b1ed39f6803acc77af9233b (patch) | |
tree | 611ccdb86508a8d190fbac2efb3aa7ea5e5a67b1 /test | |
parent | c073ba339a6820625718f7320989cfa527534563 (diff) | |
download | rails-387a7d993573b1492b1ed39f6803acc77af9233b.tar.gz rails-387a7d993573b1492b1ed39f6803acc77af9233b.tar.bz2 rails-387a7d993573b1492b1ed39f6803acc77af9233b.zip |
Standardize on "arguments" for everything -- no more "paramters"
Diffstat (limited to 'test')
-rw-r--r-- | test/cases/callbacks_test.rb | 2 | ||||
-rw-r--r-- | test/cases/parameters_test.rb | 36 | ||||
-rw-r--r-- | test/cases/queuing_test.rb | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/test/cases/callbacks_test.rb b/test/cases/callbacks_test.rb index 391c7e87c4..06e2ea4a2e 100644 --- a/test/cases/callbacks_test.rb +++ b/test/cases/callbacks_test.rb @@ -1,5 +1,5 @@ require 'helper' -require 'active_job/parameters' +require 'active_job/arguments' require 'jobs/callback_job' require 'active_support/core_ext/object/inclusion' diff --git a/test/cases/parameters_test.rb b/test/cases/parameters_test.rb index fb0b920c6e..625c59c404 100644 --- a/test/cases/parameters_test.rb +++ b/test/cases/parameters_test.rb @@ -1,48 +1,48 @@ require 'helper' -require 'active_job/parameters' +require 'active_job/arguments' require 'models/person' class ParameterSerializationTest < ActiveSupport::TestCase test 'should make no change to regular values' do - assert_equal [ 1, "something" ], ActiveJob::Parameters.serialize([ 1, "something" ]) + assert_equal [ 1, "something" ], ActiveJob::Arguments.serialize([ 1, "something" ]) end test 'should not allow complex objects' do - assert_equal [ nil ], ActiveJob::Parameters.serialize([ nil ]) - assert_equal [ 1 ], ActiveJob::Parameters.serialize([ 1 ]) - assert_equal [ 1.0 ], ActiveJob::Parameters.serialize([ 1.0 ]) - assert_equal [ 'a' ], ActiveJob::Parameters.serialize([ 'a' ]) - assert_equal [ true ], ActiveJob::Parameters.serialize([ true ]) - assert_equal [ false ], ActiveJob::Parameters.serialize([ false ]) - assert_equal [ { a: 1 } ], ActiveJob::Parameters.serialize([ { a: 1 } ]) - assert_equal [ [ 1 ] ], ActiveJob::Parameters.serialize([ [ 1 ] ]) - assert_equal [ 1_000_000_000_000_000_000_000 ], ActiveJob::Parameters.serialize([ 1_000_000_000_000_000_000_000 ]) + assert_equal [ nil ], ActiveJob::Arguments.serialize([ nil ]) + assert_equal [ 1 ], ActiveJob::Arguments.serialize([ 1 ]) + assert_equal [ 1.0 ], ActiveJob::Arguments.serialize([ 1.0 ]) + assert_equal [ 'a' ], ActiveJob::Arguments.serialize([ 'a' ]) + assert_equal [ true ], ActiveJob::Arguments.serialize([ true ]) + assert_equal [ false ], ActiveJob::Arguments.serialize([ false ]) + assert_equal [ { a: 1 } ], ActiveJob::Arguments.serialize([ { a: 1 } ]) + assert_equal [ [ 1 ] ], ActiveJob::Arguments.serialize([ [ 1 ] ]) + assert_equal [ 1_000_000_000_000_000_000_000 ], ActiveJob::Arguments.serialize([ 1_000_000_000_000_000_000_000 ]) err = assert_raises RuntimeError do - ActiveJob::Parameters.serialize([ 1, self ]) + ActiveJob::Arguments.serialize([ 1, self ]) end - assert_equal "Unsupported parameter type: #{self.class.name}", err.message + assert_equal "Unsupported argument type: #{self.class.name}", err.message end test 'should serialize records with global id' do - assert_equal [ Person.find(5).gid ], ActiveJob::Parameters.serialize([ Person.find(5) ]) + assert_equal [ Person.find(5).gid ], ActiveJob::Arguments.serialize([ Person.find(5) ]) end test 'should serialize values and records together' do - assert_equal [ 3, Person.find(5).gid ], ActiveJob::Parameters.serialize([ 3, Person.find(5) ]) + assert_equal [ 3, Person.find(5).gid ], ActiveJob::Arguments.serialize([ 3, Person.find(5) ]) end end class ParameterDeserializationTest < ActiveSupport::TestCase test 'should make no change to regular values' do - assert_equal [ 1, "something" ], ActiveJob::Parameters.deserialize([ 1, "something" ]) + assert_equal [ 1, "something" ], ActiveJob::Arguments.deserialize([ 1, "something" ]) end test 'should deserialize records with global id' do - assert_equal [ Person.find(5) ], ActiveJob::Parameters.deserialize([ Person.find(5).gid ]) + assert_equal [ Person.find(5) ], ActiveJob::Arguments.deserialize([ Person.find(5).gid ]) end test 'should serialize values and records together' do - assert_equal [ 3, Person.find(5) ], ActiveJob::Parameters.deserialize([ 3, Person.find(5).gid ]) + assert_equal [ 3, Person.find(5) ], ActiveJob::Arguments.deserialize([ 3, Person.find(5).gid ]) end end diff --git a/test/cases/queuing_test.rb b/test/cases/queuing_test.rb index 029f60f246..3dd9ecd8d2 100644 --- a/test/cases/queuing_test.rb +++ b/test/cases/queuing_test.rb @@ -13,7 +13,7 @@ class QueuingTest < ActiveSupport::TestCase assert_equal "David says hello", $BUFFER.pop end - test 'run queued job with parameters' do + test 'run queued job with arguments' do HelloJob.enqueue "Jamie" assert_equal "Jamie says hello", $BUFFER.pop end |