Skip to content
This repository

fix order dependent test in AggregationsTest #7451

Merged
merged 1 commit into from over 1 year ago

2 participants

Francesco Rodríguez Santiago Pastorino
Francesco Rodríguez
Collaborator

Ensure class variable is set to nil.

It prevents the following test to fail:

def test_do_not_run_the_converter_when_nil_was_set
  customers(:david).non_blank_gps_location = nil
  assert_nil Customer.gps_conversion_was_run
end

Check https://github.com/rails/rails/blob/master/activerecord/test/models/customer.rb#L7
for more information.

Francesco Rodríguez fix order dependent test in AggregationsTest
Ensure class variable is set to nil.

It prevents the following test to fail:

    def test_do_not_run_the_converter_when_nil_was_set
      customers(:david).non_blank_gps_location = nil
      assert_nil Customer.gps_conversion_was_run
    end

Check https://github.com/rails/rails/blob/master/activerecord/test/models/customer.rb#L7
for more information.
47cce91
Santiago Pastorino spastorino merged commit 930dbbb into from August 27, 2012
Santiago Pastorino spastorino closed this August 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 26, 2012
Francesco Rodríguez fix order dependent test in AggregationsTest
Ensure class variable is set to nil.

It prevents the following test to fail:

    def test_do_not_run_the_converter_when_nil_was_set
      customers(:david).non_blank_gps_location = nil
      assert_nil Customer.gps_conversion_was_run
    end

Check https://github.com/rails/rails/blob/master/activerecord/test/models/customer.rb#L7
for more information.
47cce91
This page is out of date. Refresh to see the latest.
2  activerecord/test/cases/aggregations_test.rb
@@ -114,6 +114,8 @@ def test_nil_return_from_converter_is_respected_when_allow_nil_is_true
114 114
     customers(:david).save
115 115
     customers(:david).reload
116 116
     assert_nil customers(:david).non_blank_gps_location
  117
+  ensure
  118
+    Customer.gps_conversion_was_run = nil
117 119
   end
118 120
 
119 121
   def test_nil_return_from_converter_results_in_failure_when_allow_nil_is_false
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.