mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add NullExampleFilter
This commit is contained in:
parent
a3c1892465
commit
481319c097
3 changed files with 21 additions and 0 deletions
11
spec/null_example_filter_spec.cr
Normal file
11
spec/null_example_filter_spec.cr
Normal file
|
@ -0,0 +1,11 @@
|
|||
require "./spec_helper"
|
||||
|
||||
describe Spectator::NullExampleFilter do
|
||||
describe "#includes?" do
|
||||
it "returns true" do
|
||||
example = PassingExample.create
|
||||
filter = Spectator::NullExampleFilter.new
|
||||
filter.includes?(example).should be_true
|
||||
end
|
||||
end
|
||||
end
|
|
@ -33,6 +33,7 @@ require "./example_filter"
|
|||
require "./source_example_filter"
|
||||
require "./line_example_filter"
|
||||
require "./name_example_filter"
|
||||
require "./null_example_filter"
|
||||
|
||||
require "./example_failed"
|
||||
require "./expectation_failed"
|
||||
|
|
9
src/spectator/null_example_filter.cr
Normal file
9
src/spectator/null_example_filter.cr
Normal file
|
@ -0,0 +1,9 @@
|
|||
module Spectator
|
||||
# Filter that matches all examples.
|
||||
class NullExampleFilter < ExampleFilter
|
||||
# Checks whether the example satisfies the filter.
|
||||
def includes?(example)
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue