-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Checker#relevant_globs method optional
- Loading branch information
1 parent
41d6245
commit 01fec45
Showing
3 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
require 'test_helper' | ||
|
||
class TestChecker | ||
class CheckerWithoutGlobs | ||
end | ||
|
||
class CheckerWithGlobs | ||
def relevant_globs | ||
%w(*.rb Rakefile) | ||
end | ||
end | ||
|
||
class CheckerRunnerTest < Minitest::Test | ||
def setup | ||
@runner = FaceControl::CheckerRunner.new(TestChecker, %w(config/file.yml Rakefile assets/foo.coffee lib/foo.rb)) | ||
def test_relevant_filenames_without_globs | ||
runner = FaceControl::CheckerRunner.new(CheckerWithoutGlobs, %w(config/file.yml lib/foo.rb)) | ||
assert_equal %w(config/file.yml lib/foo.rb), runner.send(:relevant_filenames) | ||
end | ||
|
||
def test_relevant_filenames | ||
assert_equal %w(lib/foo.rb Rakefile), @runner.send(:relevant_filenames) | ||
def test_relevant_filenames_with_globs | ||
runner = FaceControl::CheckerRunner.new(CheckerWithGlobs, %w(config/file.yml Rakefile assets/foo.coffee lib/foo.rb)) | ||
assert_equal %w(lib/foo.rb Rakefile), runner.send(:relevant_filenames) | ||
end | ||
end |