Commit Graph

23 Commits

Author SHA1 Message Date
Akira Matsuda
f7e91c7224 Lazily evaluate FileUpdateCheckerSharedTests when being included
To avoid "uninitialized constant ActiveSupport::Testing (NameError)"
2019-08-02 06:21:14 +09:00
John Hawthorn
dbfe5c6ac4 Match evented checker behavior on dir with no exts
When FileUpdateChecker is passed a directory and given an empty array of
extensions to match on, it will match any extension.

Previously, EventedFileUpdateChecker would never match any files when
given an empty array. This commit makes it EventedFileUpdateChecker
match FileUpdateChecker, and watch all extensions when given an empty
array.
2019-03-15 13:29:14 -07:00
bogdanvlviv
1a42d87e3b
Allow rubocop check more files
This commit fix pattern of filenames for `CustomCops/AssertNot` and
`CustomCops/RefuteNot`.

rubocop should check every file under `test/`.

Related to #32441, #32605
2018-04-19 23:25:39 +03:00
Daniel Colson
94333a4c31 Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
Koichi ITO
ac717d65a3 [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
Kir Shatrov
72950568dd Use frozen-string-literal in ActiveSupport 2017-07-09 15:08:29 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
yuuji.yaginuma
11d994724e remove unused variable
This removes the following warnings.

```
activesupport/test/file_update_checker_shared_tests.rb:279: warning: assigned but unused variable - checker
```
2017-02-01 08:20:13 +09:00
Rafael Mendonça França
44901ca903
Raise in the initialize not in the execute 2017-01-31 01:15:07 -05:00
kenta-s
3585155f1b Raise an error if FileUpdateChecker#execute is called with no block 2017-01-28 00:53:32 +09:00
Aaron Patterson
cd5e4188ee
Merge pull request #26829 from headius/wait_for_events_in_listen_tests
Wait for file events to propagated for slower Listen backends.
2016-10-19 15:00:38 -07:00
Ryuta Kamizono
762e3f05f3 Add Style/EmptyLines in .rubocop.yml and remove extra empty lines 2016-08-07 17:50:59 +09:00
Xavier Noria
a731125f12 applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:10:53 +02:00
Sean Griffin
1f47c4b0df Make file update checker tests more resilient on Windows
Without the `wdm` gem, it appears that `listen` keeps an open handle to
each of these files, causing them not to be removed when the tempdir
tries to clean iteslf up, and then directory to fail to unlink. In
addition to fixing that particular failure, we now construct OS agnostic
paths, and capture exceptions if the directory fails to unlink so that
minitest will report it rather than crash
2016-04-21 10:54:54 -06:00
Rafael Mendonça França
2b92069a49 Remove unused variable 2016-04-13 01:32:24 -03:00
Blake Mesdag
b0bce0b8ce Handle max_time edge cases for epoch times and add test 2016-04-12 12:07:56 -04:00
Andrew White
ae2f193c03 Use block form of Dir.mktmpdir to ensure tidy up
If the test run was interrupted in some way then it left temporary
directories inside of test causing the git worktree to be in a dirty
state. By overriding the run method we can use the block form of
Dir.mktmpdir to ensure that the directories are cleaned up no matter
which way the test run is exited.
2016-04-03 23:47:05 +01:00
eileencodes
eac2eea3e1 Fix test that fails in isolation
This test needs to have a require for the Listen gem or else it returns
an error when run by itself or with a certain order in the Active
Support tests. We use `silence_warnings` because Listen has some
warnings about private methods. It's already silenced when it's required
in Active Support EventedFileUpdateChecker.

```
1) Error:
EventedFileUpdateCheckerTest#test_should_not_execute_the_block_if_no_paths_are_given:
NameError: uninitialized constant EventedFileUpdateCheckerTest::Listen
    test/evented_file_update_checker_test.rb:21:in `teardown'
```
2015-12-18 10:17:28 -05:00
JuanitoFatas
67a7a1526f Fix instance variable not defined warning from Active Support test suite
Before

./Users/Juan/dev/rails/activesupport/test/file_update_checker_shared_tests.rb:20: warning: instance variable @tmpdir not initialized

After

No warnings
2015-11-12 17:41:13 +08:00
Xavier Noria
7edc8d9600 modernizes the test definitions in the file monitors suite 2015-11-11 07:00:47 +01:00
Xavier Noria
f3516f171b applies code style guidelines 2015-11-11 06:42:49 +01:00
Xavier Noria
b7c8ce5bc2 renames the module with shared tests for file monitors 2015-11-10 22:19:35 +01:00