1. 26 9月, 2016 8 次提交
    • K
      Per Dr. Eileen's orders :) · 4e106ee0
      Kasper Timm Hansen 提交于
      Prescribed some review fixes for myself!
      4e106ee0
    • K
      Simplify auxiliary command files directory finding. · 993c0696
      Kasper Timm Hansen 提交于
      Still vulnerable to different file structures. We likely want something
      more robust when we tackle in app commands.
      993c0696
    • K
      d5bd4b25
    • K
      Initial command structure. · 6813edc7
      Kasper Timm Hansen 提交于
      6813edc7
    • K
      Use autorun when running via Rake. · b724dbbb
      Kasper Timm Hansen 提交于
      Makes sure we get support for `Minitest.after_run` hooks and don't
      accidentally run tests twice.
      
      Requires overriding minitest `run` to respect the TESTOPTS variable.
      b724dbbb
    • K
      fffffff, Add code missing in 29f0fbd5 · 0dfc4675
      Kasper Timm Hansen 提交于
      0dfc4675
    • K
      Revise setting of run_with_rails_extension. · 29f0fbd5
      Kasper Timm Hansen 提交于
      The Rails test runner supports three ways to run tests: directly, via rake, or ruby.
      
      When Running with Ruby ala `ruby -Itest test/models/post_test.rb` our test file would
      be evaluated first, requiring `test_helper` and then `active_support/testing/autorun`
      that would then require the test file (which it hadn't been before) thus reevaluating
      it. This caused exceptions if using Active Support's declarative syntax.
      
      Fix this by shifting around when we set the how we're run to closer mimick the require
      order.
      
      If we're running with `bin/rails test` the test command file is run first and we then
      set `run_with_rails_extension`, later we hit `active_support/testing/autorun` and do
      nothing — because we've been run elsewhere.
      
      If we at this point haven't set `run_with_rails_extension` we've been running with
      `ruby` this whole time and thus we set that.
      
      We should always trigger `Minitest.autorun` as it doesn't hurt to call it twice.
      
      Consolidate the two methods into a single one that better brings out the intent of
      why they're there.
      29f0fbd5
    • K
      Require `active_support/testing/autorun`. · 0894cb98
      Kasper Timm Hansen 提交于
      Revise the require in the test command to use `active_support/testing/autorun`
      and spare us the minitest spec syntax as detailed in 5da4d514.
      
      Also move the require to the top of the file for consistency with the rest of
      Rails' requires across the project.
      0894cb98
  2. 25 9月, 2016 4 次提交
  3. 24 9月, 2016 14 次提交
  4. 23 9月, 2016 4 次提交
  5. 22 9月, 2016 2 次提交
    • K
      Fix memoization bug on ActionDispatch::TestRequest#request_method= · 7e350c67
      Kir Shatrov 提交于
      TestRequest have been overrriding request_method setter since 2009,
      but the actual implementation in Request (not TestRequest) has been
      changed since that. Now it's also using @request_method instance
      variable to keep the state.
      
      The override in TestRequest have not been calling `super`, which caused
      a bug that after accessing #requst_method the value was memoized and
      then we've never been able to change it anymore:
      
      ```
      req = ActionDispatch::TestRequest.create
      puts "was: #{req.request_method}" # memoized here
      req.request_method = "POST"
      puts "became: #{req.request_method}"
      ```
      
      output:
      
      ```
      was: GET
      became: GET
      ```
      
      Since the whole purpose of overriding the setter in TestRequest is to
      upcase it, I'm changing it to `super(method.to_s.upcase)`
      7e350c67
    • R
      Merge pull request #26524 from y-yagi/add_check_of_argument · bf19c223
      Richard Schneeman 提交于
      add check of argument
      bf19c223
  6. 21 9月, 2016 4 次提交
  7. 20 9月, 2016 4 次提交