This project is archived and is in readonly mode.
[PATCH] visibility of fixture accssor methods
-
Nobuhiro IMAI
- Title changed from visibility of fixture accssor methods to [PATCH] visibility of fixture accssor methods
- Assigned user set to Pratik
How about to include this patch into the next release? 2.3.5?
Thanks,
-
CancelProfileIsBroken
- Tag changed from 2.3.3, 2.3.4, activerecord, fixtures, patch to 2.3.3, 2.3.4, activerecord, bugmash, fixtures, patch
- Assigned user cleared.
-
Elad Meidar
+1 on the patch, applies cleanly on 2-3-stable and Master. @Nobuhiro: although it's all seems like the correct way to go, are you sure this won't backfire on something ?
-
Elad Meidar
- Tag changed from 2.3.3, 2.3.4, activerecord, bugmash, fixtures, patch to 2.3.3, 2.3.4, activerecord, bugmash, bugmash-review, fixtures, patch
-
Nobuhiro IMAI
@Elad: Fixture accessor methods are only used in test scripts, so that it's ok even if the visibility is private, I guess. Thanks.
-
sr.iniv.t
+1 verified. Patch applies cleanly.
-
CancelProfileIsBroken
- Tag changed from 2.3.3, 2.3.4, activerecord, bugmash, bugmash-review, fixtures, patch to 2.3.3, 2.3.4, activerecord, bugmash-review, fixtures, patch
-
CancelProfileIsBroken
- Tag changed from 2.3.3, 2.3.4, activerecord, bugmash-review, fixtures, patch to 2.3.3, 2.3.4, activerecord, bugmash-review, fixtures, patch
-
Nobuhiro IMAI
- Tag changed from 2.3.3, 2.3.4, activerecord, bugmash-review, fixtures, patch to 2.3.6, activerecord, bugmash-review, fixtures, patch
With Rails 2.3.5, the situation seems to have deteriorated.
$ ruby -Itest test/unit/test_result_test.rb -v Loaded suite test/unit/test_result_test Started test_results(ActionController::IntegrationTest): . test_results(ActionController::TestCase): . test_results(ActionMailer::TestCase): . test_results(ActionView::TestCase): E test_results(ActiveRecord::TestCase): . test_results(ActiveSupport::TestCase): . test_results(TestResultTest): . test_the_truth(TestResultTest): . Finished in 0.356134 seconds. 1) Error: test_results(ActionView::TestCase): TypeError: wrong argument type Class (expected Module) 8 tests, 1 assertions, 0 failures, 1 errorsThis is because the hook, setup_with_controller(), is added to ActionView::TestCase.
.../actionpack-2.3.5/lib/action_view/test_case.rb:81:in `helper_class' .../actionpack-2.3.5/lib/action_view/test_case.rb:106:in `include_helper_modules!' .../actionpack-2.3.5/lib/action_view/test_case.rb:59:in `send' .../actionpack-2.3.5/lib/action_view/test_case.rb:59:in `setup_with_controller' (snip)and in determine_default_helper_class(), trying to include ActionView::TestCase itself as a helper module, then raises TypeError.
At this point, determine_default_helper_class should be as follow:def determine_default_helper_class(name) - name.sub(/Test$/, '').constantize + name.sub!(/Test\z/, '').try(:constantize) rescue NameError nil endAnyway, it's no problem if the fixtures accessor methods are private.
Attached patch is cleanly applied even now, at least using git-apply. Thanks. -
Rizwan Reza
- Tag changed from 2.3.6, activerecord, bugmash-review, fixtures, patch to 2.3.6, activerecord, bugmash, fixtures, patch
-
Casey Dreier
+1 Verified that patch applies cleanly for 2.3-stable branch.
-
Rizwan Reza
- Milestone set to 2.3.6
- State changed from new to open
Casey, also update us if the tests pass.
-
Rizwan Reza
- Tag changed from 2.3.6, activerecord, bugmash, fixtures, patch to 2.3.6, activerecord, bugmash-review, fixtures, patch
-
Casey Dreier
Yes, all tests on master pass with this patch applied.
-
Rizwan Reza
- Tag changed from 2.3.6, activerecord, bugmash-review, fixtures, patch to 2.3.6, activerecord, bugmash, bugmash-review, fixtures, patch
-
Rizwan Reza
- Milestone cleared.
- Tag changed from 2.3.6, activerecord, bugmash, bugmash-review, fixtures, patch to 2.3.6, 3.0, activerecord, bugmash, bugmash-review, fixtures, patch
- State changed from open to verified
The patch above is for both: master and 2-3-stable.
-
Rizwan Reza
- Tag changed from 2.3.6, 3.0, activerecord, bugmash, bugmash-review, fixtures, patch to 2.3.6, 3.0, activerecord, bugmash, fixtures, patch
-
Rizwan Reza
- Tag changed from 2.3.6, 3.0, activerecord, bugmash, fixtures, patch to 2.3.6, 3.0, activerecord, bugmash-review, fixtures, patch
-
Rizwan Reza
- No changes were found…
-
José Valim
- Milestone cleared.
- Tag changed from 2.3.6, 3.0, activerecord, bugmash-review, fixtures, patch to 2.3.6, 3.0, activerecord, bugmash, fixtures, patch
- State changed from verified to open
- Assigned user set to José Valim
The patch does not apply on master anymore. Can anyone rebase please?
-
Wijnand Wiersma
I attached patches that apply to master and 2-3-stable.
-
Casey Dreier
+1 Verified that new patches apply cleanly to both master and 2.3-stable branch.
Does not cause any failing tests on either branch. -
Repository
- State changed from open to resolved
(from [5d0afe75ebd7d88f982a57af84dba1ef62b14c0c]) prevent to run fixture accessor (e.g. test_foos for TestFoo model) as a test case [#2992 state:resolved]
Signed-off-by: Wijnand Wiersma wijnand@videre.net
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/5d0afe75ebd7d88f982a57af84dba1... -
José Valim
- Tag changed from 2.3.6, 3.0, activerecord, bugmash, fixtures, patch to 2.3.6, 3.0, activerecord, fixtures, patch
