Add NullExampleFilter

This commit is contained in:
Michael Miller 2019-03-25 10:58:49 -06:00
parent a3c1892465
commit 481319c097
3 changed files with 21 additions and 0 deletions

View 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

View file

@ -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"

View 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