Skip to content
This repository
Browse code

Merge pull request #11886 from jetthoughts/remove_redundant_assert_fr…

…om_datatype_test

Removed redundant asserts for assigns attribute operation
  • Loading branch information...
commit f04b75f5b7b07d4ad4ad58dba01a5493f3198ab6 2 parents 41f50be + f55504a
Yves Senn senny authored

Showing 1 changed file with 28 additions and 28 deletions. Show diff stats Hide diff stats

  1. +28 28 activerecord/test/cases/adapters/postgresql/datatype_test.rb
56 activerecord/test/cases/adapters/postgresql/datatype_test.rb
@@ -311,11 +311,11 @@ def test_create_tstzrange
311 311 def test_update_tstzrange
312 312 skip "PostgreSQL 9.2 required for range datatypes" unless @connection.supports_ranges?
313 313 new_tstzrange = Time.parse('2010-01-01 14:30:00 CDT')...Time.parse('2011-02-02 14:30:00 CET')
314   - assert @first_range.tstz_range = new_tstzrange
  314 + @first_range.tstz_range = new_tstzrange
315 315 assert @first_range.save
316 316 assert @first_range.reload
317 317 assert_equal new_tstzrange, @first_range.tstz_range
318   - assert @first_range.tstz_range = Time.parse('2010-01-01 14:30:00 +0100')...Time.parse('2010-01-01 13:30:00 +0000')
  318 + @first_range.tstz_range = Time.parse('2010-01-01 14:30:00 +0100')...Time.parse('2010-01-01 13:30:00 +0000')
319 319 assert @first_range.save
320 320 assert @first_range.reload
321 321 assert_nil @first_range.tstz_range
@@ -335,11 +335,11 @@ def test_update_tsrange
335 335 skip "PostgreSQL 9.2 required for range datatypes" unless @connection.supports_ranges?
336 336 tz = ::ActiveRecord::Base.default_timezone
337 337 new_tsrange = Time.send(tz, 2010, 1, 1, 14, 30, 0)...Time.send(tz, 2011, 2, 2, 14, 30, 0)
338   - assert @first_range.ts_range = new_tsrange
  338 + @first_range.ts_range = new_tsrange
339 339 assert @first_range.save
340 340 assert @first_range.reload
341 341 assert_equal new_tsrange, @first_range.ts_range
342   - assert @first_range.ts_range = Time.send(tz, 2010, 1, 1, 14, 30, 0)...Time.send(tz, 2010, 1, 1, 14, 30, 0)
  342 + @first_range.ts_range = Time.send(tz, 2010, 1, 1, 14, 30, 0)...Time.send(tz, 2010, 1, 1, 14, 30, 0)
343 343 assert @first_range.save
344 344 assert @first_range.reload
345 345 assert_nil @first_range.ts_range
@@ -357,11 +357,11 @@ def test_create_numrange
357 357 def test_update_numrange
358 358 skip "PostgreSQL 9.2 required for range datatypes" unless @connection.supports_ranges?
359 359 new_numrange = BigDecimal.new('0.5')...BigDecimal.new('1')
360   - assert @first_range.num_range = new_numrange
  360 + @first_range.num_range = new_numrange
361 361 assert @first_range.save
362 362 assert @first_range.reload
363 363 assert_equal new_numrange, @first_range.num_range
364   - assert @first_range.num_range = BigDecimal.new('0.5')...BigDecimal.new('0.5')
  364 + @first_range.num_range = BigDecimal.new('0.5')...BigDecimal.new('0.5')
365 365 assert @first_range.save
366 366 assert @first_range.reload
367 367 assert_nil @first_range.num_range
@@ -379,11 +379,11 @@ def test_create_daterange
379 379 def test_update_daterange
380 380 skip "PostgreSQL 9.2 required for range datatypes" unless @connection.supports_ranges?
381 381 new_daterange = Date.new(2012, 2, 3)...Date.new(2012, 2, 10)
382   - assert @first_range.date_range = new_daterange
  382 + @first_range.date_range = new_daterange
383 383 assert @first_range.save
384 384 assert @first_range.reload
385 385 assert_equal new_daterange, @first_range.date_range
386   - assert @first_range.date_range = Date.new(2012, 2, 3)...Date.new(2012, 2, 3)
  386 + @first_range.date_range = Date.new(2012, 2, 3)...Date.new(2012, 2, 3)
387 387 assert @first_range.save
388 388 assert @first_range.reload
389 389 assert_nil @first_range.date_range
@@ -401,11 +401,11 @@ def test_create_int4range
401 401 def test_update_int4range
402 402 skip "PostgreSQL 9.2 required for range datatypes" unless @connection.supports_ranges?
403 403 new_int4range = 6...10
404   - assert @first_range.int4_range = new_int4range
  404 + @first_range.int4_range = new_int4range
405 405 assert @first_range.save
406 406 assert @first_range.reload
407 407 assert_equal new_int4range, @first_range.int4_range
408   - assert @first_range.int4_range = 3...3
  408 + @first_range.int4_range = 3...3
409 409 assert @first_range.save
410 410 assert @first_range.reload
411 411 assert_nil @first_range.int4_range
@@ -423,11 +423,11 @@ def test_create_int8range
423 423 def test_update_int8range
424 424 skip "PostgreSQL 9.2 required for range datatypes" unless @connection.supports_ranges?
425 425 new_int8range = 60000...10000000
426   - assert @first_range.int8_range = new_int8range
  426 + @first_range.int8_range = new_int8range
427 427 assert @first_range.save
428 428 assert @first_range.reload
429 429 assert_equal new_int8range, @first_range.int8_range
430   - assert @first_range.int8_range = 39999...39999
  430 + @first_range.int8_range = 39999...39999
431 431 assert @first_range.save
432 432 assert @first_range.reload
433 433 assert_nil @first_range.int8_range
@@ -435,10 +435,10 @@ def test_update_int8range
435 435
436 436 def test_update_tsvector
437 437 new_text_vector = "'new' 'text' 'vector'"
438   - assert @first_tsvector.text_vector = new_text_vector
  438 + @first_tsvector.text_vector = new_text_vector
439 439 assert @first_tsvector.save
440 440 assert @first_tsvector.reload
441   - assert @first_tsvector.text_vector = new_text_vector
  441 + @first_tsvector.text_vector = new_text_vector
442 442 assert @first_tsvector.save
443 443 assert @first_tsvector.reload
444 444 assert_equal new_text_vector, @first_tsvector.text_vector
@@ -479,11 +479,11 @@ def test_oid_values
479 479
480 480 def test_update_integer_array
481 481 new_value = [32800,95000,29350,17000]
482   - assert @first_array.commission_by_quarter = new_value
  482 + @first_array.commission_by_quarter = new_value
483 483 assert @first_array.save
484 484 assert @first_array.reload
485 485 assert_equal new_value, @first_array.commission_by_quarter
486   - assert @first_array.commission_by_quarter = new_value
  486 + @first_array.commission_by_quarter = new_value
487 487 assert @first_array.save
488 488 assert @first_array.reload
489 489 assert_equal new_value, @first_array.commission_by_quarter
@@ -491,11 +491,11 @@ def test_update_integer_array
491 491
492 492 def test_update_text_array
493 493 new_value = ['robby','robert','rob','robbie']
494   - assert @first_array.nicknames = new_value
  494 + @first_array.nicknames = new_value
495 495 assert @first_array.save
496 496 assert @first_array.reload
497 497 assert_equal new_value, @first_array.nicknames
498   - assert @first_array.nicknames = new_value
  498 + @first_array.nicknames = new_value
499 499 assert @first_array.save
500 500 assert @first_array.reload
501 501 assert_equal new_value, @first_array.nicknames
@@ -503,7 +503,7 @@ def test_update_text_array
503 503
504 504 def test_update_money
505 505 new_value = BigDecimal.new('123.45')
506   - assert @first_money.wealth = new_value
  506 + @first_money.wealth = new_value
507 507 assert @first_money.save
508 508 assert @first_money.reload
509 509 assert_equal new_value, @first_money.wealth
@@ -512,8 +512,8 @@ def test_update_money
512 512 def test_update_number
513 513 new_single = 789.012
514 514 new_double = 789012.345
515   - assert @first_number.single = new_single
516   - assert @first_number.double = new_double
  515 + @first_number.single = new_single
  516 + @first_number.double = new_double
517 517 assert @first_number.save
518 518 assert @first_number.reload
519 519 assert_equal new_single, @first_number.single
@@ -521,7 +521,7 @@ def test_update_number
521 521 end
522 522
523 523 def test_update_time
524   - assert @first_time.time_interval = '2 years 3 minutes'
  524 + @first_time.time_interval = '2 years 3 minutes'
525 525 assert @first_time.save
526 526 assert @first_time.reload
527 527 assert_equal '2 years 00:03:00', @first_time.time_interval
@@ -531,9 +531,9 @@ def test_update_network_address
531 531 new_inet_address = '10.1.2.3/32'
532 532 new_cidr_address = '10.0.0.0/8'
533 533 new_mac_address = 'bc:de:f0:12:34:56'
534   - assert @first_network_address.cidr_address = new_cidr_address
535   - assert @first_network_address.inet_address = new_inet_address
536   - assert @first_network_address.mac_address = new_mac_address
  534 + @first_network_address.cidr_address = new_cidr_address
  535 + @first_network_address.inet_address = new_inet_address
  536 + @first_network_address.mac_address = new_mac_address
537 537 assert @first_network_address.save
538 538 assert @first_network_address.reload
539 539 assert_equal @first_network_address.cidr_address, new_cidr_address
@@ -544,8 +544,8 @@ def test_update_network_address
544 544 def test_update_bit_string
545 545 new_bit_string = '11111111'
546 546 new_bit_string_varying = '0xFF'
547   - assert @first_bit_string.bit_string = new_bit_string
548   - assert @first_bit_string.bit_string_varying = new_bit_string_varying
  547 + @first_bit_string.bit_string = new_bit_string
  548 + @first_bit_string.bit_string_varying = new_bit_string_varying
549 549 assert @first_bit_string.save
550 550 assert @first_bit_string.reload
551 551 assert_equal new_bit_string, @first_bit_string.bit_string
@@ -560,7 +560,7 @@ def test_invalid_hex_string
560 560
561 561 def test_update_oid
562 562 new_value = 567890
563   - assert @first_oid.obj_id = new_value
  563 + @first_oid.obj_id = new_value
564 564 assert @first_oid.save
565 565 assert @first_oid.reload
566 566 assert_equal new_value, @first_oid.obj_id

0 comments on commit f04b75f

Please sign in to comment.
Something went wrong with that request. Please try again.