diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b52f324..f89c555 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,10 +14,17 @@ before_script: spec: script: - - crystal spec + - crystal spec --error-on-warnings - bin/ameba - crystal tool format --check +nightly: + image: "crystallang/crystal:nightly" + allow_failure: true + script: + - crystal spec --error-on-warnings + - crystal tool format --check + pages: stage: deploy dependencies: diff --git a/shard.yml b/shard.yml index 77b397c..22461d6 100644 --- a/shard.yml +++ b/shard.yml @@ -6,7 +6,7 @@ description: | authors: - Michael Miller -crystal: 0.30.1 +crystal: 0.31.0 license: MIT diff --git a/spec/dsl/sample_example_group_builder_spec.cr b/spec/dsl/sample_example_group_builder_spec.cr index 6fedcc2..a5a9d88 100644 --- a/spec/dsl/sample_example_group_builder_spec.cr +++ b/spec/dsl/sample_example_group_builder_spec.cr @@ -291,7 +291,7 @@ describe Spectator::DSL::SampleExampleGroupBuilder do factory = Spectator::DSL::ExampleFactory.new(SpyExample) symbol = :test count = 3 - expected = Array.new(SAMPLE_VALUES_COLLECTION.size * count) { |i| SAMPLE_VALUES_COLLECTION[i / count] } + expected = Array.new(SAMPLE_VALUES_COLLECTION.size * count) { |i| SAMPLE_VALUES_COLLECTION[i // count] } create_proc = ->(s : SampleValueCollection) { s.create } builder = Spectator::DSL::SampleExampleGroupBuilder.new("foobar", SampleValueCollection, create_proc, "value", symbol) count.times { builder.add_child(factory) } diff --git a/spec/helpers/errored_example.cr b/spec/helpers/errored_example.cr index 7fec2e4..aa82617 100644 --- a/spec/helpers/errored_example.cr +++ b/spec/helpers/errored_example.cr @@ -1,17 +1,17 @@ # Example that always raises an exception. class ErroredExample < Spectator::RunnableExample # Dummy description. - def what + def what : Symbol | String "ERROR" end # Dummy source. - def source + def source : ::Spectator::Source ::Spectator::Source.new(__FILE__, __LINE__) end # Dummy symbolic flag. - def symbolic? + def symbolic? : Bool false end diff --git a/spec/helpers/failing_example.cr b/spec/helpers/failing_example.cr index 25cd460..a0e972d 100644 --- a/spec/helpers/failing_example.cr +++ b/spec/helpers/failing_example.cr @@ -1,17 +1,17 @@ # Example that always fails. class FailingExample < Spectator::RunnableExample # Dummy description. - def what + def what : Symbol | String "FAIL" end # Dummy source. - def source + def source : ::Spectator::Source ::Spectator::Source.new(__FILE__, __LINE__) end # Dummy symbolic flag. - def symbolic? + def symbolic? : Bool false end diff --git a/spec/helpers/passing_example.cr b/spec/helpers/passing_example.cr index d1e6f44..6d03aae 100644 --- a/spec/helpers/passing_example.cr +++ b/spec/helpers/passing_example.cr @@ -6,17 +6,17 @@ class PassingExample < Spectator::RunnableExample end # Dummy description. - def what + def what : Symbol | String "PASS" end # Dummy source. - def source + def source : ::Spectator::Source ::Spectator::Source.new(__FILE__, __LINE__) end # Dummy symbolic flag. - def symbolic? + def symbolic? : Bool @symbolic end diff --git a/spec/helpers/spy_example.cr b/spec/helpers/spy_example.cr index 70c256a..32b6474 100644 --- a/spec/helpers/spy_example.cr +++ b/spec/helpers/spy_example.cr @@ -2,17 +2,17 @@ # This is useful for capturing what's going on when an event is running. class SpyExample < Spectator::RunnableExample # Dummy description. - def what + def what : Symbol | String "SPY" end # Dummy source. - def source + def source : ::Spectator::Source ::Spectator::Source.new(__FILE__, __LINE__) end # Dummy symbolic flag. - def symbolic? + def symbolic? : Bool false end diff --git a/spec/pending_example_spec.cr b/spec/pending_example_spec.cr index 6809816..8ed23df 100644 --- a/spec/pending_example_spec.cr +++ b/spec/pending_example_spec.cr @@ -1,15 +1,15 @@ require "./spec_helper" class ConcretePendingExample < Spectator::PendingExample - def what + def what : Symbol | String "PENDING_TEST_EXAMPLE" end - def source + def source : ::Spectator::Source ::Spectator::Source.new(__FILE__, __LINE__) end - def symbolic? + def symbolic? : Bool false end diff --git a/src/spectator/composite_example_filter.cr b/src/spectator/composite_example_filter.cr index 0b1f9d3..7f776ba 100644 --- a/src/spectator/composite_example_filter.cr +++ b/src/spectator/composite_example_filter.cr @@ -6,7 +6,7 @@ module Spectator end # Checks whether the example satisfies the filter. - def includes?(example) + def includes?(example) : Bool @filters.any?(&.includes?(example)) end end diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index 1957d03..bed9c59 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -1457,7 +1457,7 @@ module Spectator::DSL # Create a class derived from `RunnableExample` to run the test code. _spectator_example(Example%example, Test%example, ::Spectator::RunnableExample, {{what}}) do # Source where the example originated from. - def source + def source : ::Spectator::Source ::Spectator::Source.new({{_source_file}}, {{_source_line}}) end @@ -1534,7 +1534,7 @@ module Spectator::DSL # Create a class derived from `PendingExample` to skip the test code. _spectator_example(Example%example, Test%example, ::Spectator::PendingExample, {{what}}) do # Source where the example originated from. - def source + def source : ::Spectator::Source ::Spectator::Source.new({{_source_file}}, {{_source_line}}) end end @@ -1650,7 +1650,7 @@ module Spectator::DSL getter instance # Indicates whether the example references a method. - def symbolic? + def symbolic? : Bool {{what.is_a?(StringLiteral) && what.starts_with?('#') ? true : false}} end @@ -1658,7 +1658,7 @@ module Spectator::DSL {{block.body}} # Description for the test. - def what + def what : String | Symbol {{what.is_a?(StringLiteral) ? what : what.stringify}} end end diff --git a/src/spectator/dummy_example.cr b/src/spectator/dummy_example.cr index 82ddcb8..62e11c9 100644 --- a/src/spectator/dummy_example.cr +++ b/src/spectator/dummy_example.cr @@ -10,17 +10,17 @@ module Spectator # This class shouldn't be used, it's just to trick the compiler. private class DummyExample < RunnableExample # Dummy description. - def what + def what : Symbol | String "DUMMY" end # Dummy symbolic flag. - def symbolic? + def symbolic? : Bool false end # Dummy source. - def source + def source : Source Source.new(__FILE__, __LINE__) end diff --git a/src/spectator/example.cr b/src/spectator/example.cr index d12363e..eee5847 100644 --- a/src/spectator/example.cr +++ b/src/spectator/example.cr @@ -4,8 +4,12 @@ module Spectator # Base class for all types of examples. # Concrete types must implement the `#run_impl, `#what`, `#instance`, and `#source` methods. abstract class Example < ExampleComponent + @finished = false + # Indicates whether the example has already been run. - getter? finished = false + def finished? : Bool + @finished + end # Group that the example belongs to. getter group : ExampleGroup @@ -36,12 +40,12 @@ module Spectator end # Indicates there is only one example to run. - def example_count + def example_count : Int 1 end # Retrieve the current example. - def [](index : Int) + def [](index : Int) : Example self end diff --git a/src/spectator/example_component.cr b/src/spectator/example_component.cr index 9c9fa95..6ac628f 100644 --- a/src/spectator/example_component.cr +++ b/src/spectator/example_component.cr @@ -3,7 +3,7 @@ module Spectator # This is used as the base node type for the composite design pattern. abstract class ExampleComponent # Text that describes the context or test. - abstract def what : String + abstract def what : Symbol | String # Indicates whether the example (or group) has been completely run. abstract def finished? : Bool diff --git a/src/spectator/example_group.cr b/src/spectator/example_group.cr index 6e25a93..0d0aa1a 100644 --- a/src/spectator/example_group.cr +++ b/src/spectator/example_group.cr @@ -18,6 +18,7 @@ module Spectator # Creates the example group. # The hooks are stored to be triggered later. def initialize(@hooks : ExampleHooks, @conditions : ExampleConditions) + @example_count = 0 @before_all_hooks_run = false @after_all_hooks_run = false end @@ -53,7 +54,9 @@ module Spectator end # Number of examples in this group and all sub-groups. - getter example_count = 0 + def example_count : Int + @example_count + end # Retrieves an example by its index. # This recursively searches for an example. @@ -118,7 +121,7 @@ module Spectator end # Checks whether all examples in the group have been run. - def finished? + def finished? : Bool children.all?(&.finished?) end diff --git a/src/spectator/formatting/failure_junit_test_case.cr b/src/spectator/formatting/failure_junit_test_case.cr index 964e673..99b0265 100644 --- a/src/spectator/formatting/failure_junit_test_case.cr +++ b/src/spectator/formatting/failure_junit_test_case.cr @@ -11,7 +11,7 @@ module Spectator::Formatting end # Status string specific to the result type. - private def status + private def status : String "FAIL" end diff --git a/src/spectator/formatting/human_time.cr b/src/spectator/formatting/human_time.cr index 0eff947..c7ec687 100644 --- a/src/spectator/formatting/human_time.cr +++ b/src/spectator/formatting/human_time.cr @@ -25,15 +25,15 @@ module Spectator::Formatting return "#{seconds.round(2)} seconds" if seconds < 60 int_seconds = seconds.to_i - minutes = int_seconds / 60 + minutes = int_seconds // 60 int_seconds %= 60 return sprintf("%i:%02i", minutes, int_seconds) if minutes < 60 - hours = minutes / 60 + hours = minutes // 60 minutes %= 60 return sprintf("%i:%02i:%02i", hours, minutes, int_seconds) if hours < 24 - days = hours / 24 + days = hours // 24 hours %= 24 sprintf("%i days %i:%02i:%02i", days, hours, minutes, int_seconds) end diff --git a/src/spectator/formatting/skipped_junit_test_case.cr b/src/spectator/formatting/skipped_junit_test_case.cr index 3b6ed56..6b90b4d 100644 --- a/src/spectator/formatting/skipped_junit_test_case.cr +++ b/src/spectator/formatting/skipped_junit_test_case.cr @@ -11,7 +11,7 @@ module Spectator::Formatting end # Status string specific to the result type. - private def status + private def status : String "TODO" end diff --git a/src/spectator/formatting/successful_junit_test_case.cr b/src/spectator/formatting/successful_junit_test_case.cr index b45bc87..108e966 100644 --- a/src/spectator/formatting/successful_junit_test_case.cr +++ b/src/spectator/formatting/successful_junit_test_case.cr @@ -9,7 +9,7 @@ module Spectator::Formatting end # Status string specific to the result type. - private def status + private def status : String "PASS" end end diff --git a/src/spectator/line_example_filter.cr b/src/spectator/line_example_filter.cr index 112e086..85cd739 100644 --- a/src/spectator/line_example_filter.cr +++ b/src/spectator/line_example_filter.cr @@ -6,7 +6,7 @@ module Spectator end # Checks whether the example satisfies the filter. - def includes?(example) + def includes?(example) : Bool @line == example.source.line end end diff --git a/src/spectator/matchers/all_matcher.cr b/src/spectator/matchers/all_matcher.cr index d43bda8..f413fbd 100644 --- a/src/spectator/matchers/all_matcher.cr +++ b/src/spectator/matchers/all_matcher.cr @@ -16,7 +16,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "all #{matcher.description}" end diff --git a/src/spectator/matchers/array_matcher.cr b/src/spectator/matchers/array_matcher.cr index f3c3940..314a31e 100644 --- a/src/spectator/matchers/array_matcher.cr +++ b/src/spectator/matchers/array_matcher.cr @@ -17,7 +17,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "contains exactly #{expected.label}" end diff --git a/src/spectator/matchers/attributes_matcher.cr b/src/spectator/matchers/attributes_matcher.cr index a447d4a..93cd62a 100644 --- a/src/spectator/matchers/attributes_matcher.cr +++ b/src/spectator/matchers/attributes_matcher.cr @@ -20,7 +20,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "has attributes #{expected.label}" end @@ -39,7 +39,7 @@ module Spectator::Matchers def negated_match(actual : TestExpression(T)) : MatchData forall T snapshot = snapshot_values(actual.value) if match?(snapshot) - FailedMatchData.new("#{actual.label} has attributes #{expected.label}", **values(snapshot)) + FailedMatchData.new("#{actual.label} has attributes #{expected.label}", **negated_values(snapshot)) else SuccessfulMatchData.new end @@ -79,5 +79,17 @@ module Spectator::Matchers } {% end %} end + + # Produces the tuple for the failed negated match data from a snapshot of the attributes. + private def negated_values(snapshot) + {% begin %} + { + {% for attribute in ExpectedType.keys %} + {{"expected " + attribute.stringify}}: "Not #{expected.value[{{attribute.symbolize}}].inspect}", + {{"actual " + attribute.stringify}}: snapshot[{{attribute.symbolize}}].inspect, + {% end %} + } + {% end %} + end end end diff --git a/src/spectator/matchers/case_matcher.cr b/src/spectator/matchers/case_matcher.cr index 3ba55f3..e7f0891 100644 --- a/src/spectator/matchers/case_matcher.cr +++ b/src/spectator/matchers/case_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "matches #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value === actual.value end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not match #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} matched #{expected.label}" end end diff --git a/src/spectator/matchers/change_exact_matcher.cr b/src/spectator/matchers/change_exact_matcher.cr index 48dcf9f..7245386 100644 --- a/src/spectator/matchers/change_exact_matcher.cr +++ b/src/spectator/matchers/change_exact_matcher.cr @@ -21,7 +21,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "changes #{expression.label} from #{expected_before.inspect} to #{expected_after.inspect}" end diff --git a/src/spectator/matchers/change_from_matcher.cr b/src/spectator/matchers/change_from_matcher.cr index 82a9267..cafb51d 100644 --- a/src/spectator/matchers/change_from_matcher.cr +++ b/src/spectator/matchers/change_from_matcher.cr @@ -19,7 +19,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "changes #{expression.label} from #{expected}" end diff --git a/src/spectator/matchers/change_matcher.cr b/src/spectator/matchers/change_matcher.cr index ad8ca89..2b016d5 100644 --- a/src/spectator/matchers/change_matcher.cr +++ b/src/spectator/matchers/change_matcher.cr @@ -17,7 +17,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "changes #{expression.label}" end diff --git a/src/spectator/matchers/change_relative_matcher.cr b/src/spectator/matchers/change_relative_matcher.cr index adb4cdc..2f170eb 100644 --- a/src/spectator/matchers/change_relative_matcher.cr +++ b/src/spectator/matchers/change_relative_matcher.cr @@ -17,7 +17,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "changes #{expression.label} #{@relativity}" end diff --git a/src/spectator/matchers/change_to_matcher.cr b/src/spectator/matchers/change_to_matcher.cr index 65f1ce5..a05587a 100644 --- a/src/spectator/matchers/change_to_matcher.cr +++ b/src/spectator/matchers/change_to_matcher.cr @@ -19,7 +19,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "changes #{expression.label} to #{expected}" end diff --git a/src/spectator/matchers/collection_matcher.cr b/src/spectator/matchers/collection_matcher.cr index bfa88f2..44f2ee8 100644 --- a/src/spectator/matchers/collection_matcher.cr +++ b/src/spectator/matchers/collection_matcher.cr @@ -8,12 +8,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is in #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value.includes?(actual.value) end @@ -23,7 +23,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not in #{expected.label}" end @@ -34,7 +34,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is in #{expected.label}" end diff --git a/src/spectator/matchers/contain_matcher.cr b/src/spectator/matchers/contain_matcher.cr index 53389fc..26d3287 100644 --- a/src/spectator/matchers/contain_matcher.cr +++ b/src/spectator/matchers/contain_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "contains #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value.all? do |item| actual.value.includes?(item) end @@ -24,7 +24,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not match #{expected.label}" end @@ -35,7 +35,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} contains #{expected.label}" end diff --git a/src/spectator/matchers/empty_matcher.cr b/src/spectator/matchers/empty_matcher.cr index a8ccfe9..c64c6d7 100644 --- a/src/spectator/matchers/empty_matcher.cr +++ b/src/spectator/matchers/empty_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is empty" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value.empty? end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not empty" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is empty" end end diff --git a/src/spectator/matchers/end_with_matcher.cr b/src/spectator/matchers/end_with_matcher.cr index ed76381..cc28e9a 100644 --- a/src/spectator/matchers/end_with_matcher.cr +++ b/src/spectator/matchers/end_with_matcher.cr @@ -17,7 +17,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "ends with #{expected.label}" end diff --git a/src/spectator/matchers/equality_matcher.cr b/src/spectator/matchers/equality_matcher.cr index 5d58454..bcdcd44 100644 --- a/src/spectator/matchers/equality_matcher.cr +++ b/src/spectator/matchers/equality_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "equals #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value == actual.value end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not equal #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} equals #{expected.label}" end end diff --git a/src/spectator/matchers/exception_matcher.cr b/src/spectator/matchers/exception_matcher.cr index 981845c..6455df5 100644 --- a/src/spectator/matchers/exception_matcher.cr +++ b/src/spectator/matchers/exception_matcher.cr @@ -21,7 +21,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String if (message = @expected) "raises #{ExceptionType} with message #{message}" else diff --git a/src/spectator/matchers/failed_match_data.cr b/src/spectator/matchers/failed_match_data.cr index f1925ce..3e0857a 100644 --- a/src/spectator/matchers/failed_match_data.cr +++ b/src/spectator/matchers/failed_match_data.cr @@ -4,7 +4,7 @@ module Spectator::Matchers # Information about a failed match. struct FailedMatchData < MatchData # Indicates that the match failed. - def matched? + def matched? : Bool false end diff --git a/src/spectator/matchers/greater_than_equal_matcher.cr b/src/spectator/matchers/greater_than_equal_matcher.cr index 5f4e20b..08eb88c 100644 --- a/src/spectator/matchers/greater_than_equal_matcher.cr +++ b/src/spectator/matchers/greater_than_equal_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "greater than or equal to #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value >= expected.value end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is less than #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is greater than or equal to #{expected.label}" end diff --git a/src/spectator/matchers/greater_than_matcher.cr b/src/spectator/matchers/greater_than_matcher.cr index c51303b..5dfc90c 100644 --- a/src/spectator/matchers/greater_than_matcher.cr +++ b/src/spectator/matchers/greater_than_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "greater than #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value > expected.value end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is less than or equal to #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is greater than #{expected.label}" end diff --git a/src/spectator/matchers/have_key_matcher.cr b/src/spectator/matchers/have_key_matcher.cr index e3f2560..c579930 100644 --- a/src/spectator/matchers/have_key_matcher.cr +++ b/src/spectator/matchers/have_key_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "has key #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value.has_key?(expected.value) end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not have key #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} has key #{expected.label}" end diff --git a/src/spectator/matchers/have_matcher.cr b/src/spectator/matchers/have_matcher.cr index 5dd0151..d67eb35 100644 --- a/src/spectator/matchers/have_matcher.cr +++ b/src/spectator/matchers/have_matcher.cr @@ -8,12 +8,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "includes #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T if (value = actual.value).is_a?(String) match_string?(value) else @@ -46,7 +46,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not include #{expected.label}" end @@ -57,7 +57,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} includes #{expected.label}" end diff --git a/src/spectator/matchers/have_predicate_matcher.cr b/src/spectator/matchers/have_predicate_matcher.cr index dedc70e..93bcca6 100644 --- a/src/spectator/matchers/have_predicate_matcher.cr +++ b/src/spectator/matchers/have_predicate_matcher.cr @@ -17,7 +17,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "has #{expected.label}" end @@ -48,7 +48,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not have #{expected.label}" end @@ -59,7 +59,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} has #{expected.label}" end @@ -76,7 +76,7 @@ module Spectator::Matchers end # Checks if all predicate methods from the snapshot of them are satisified. - private def match?(snapshot) + private def match?(snapshot) : Bool # Test each predicate and immediately return false if one is false. {% for attribute in ExpectedType.keys %} return false unless snapshot[{{attribute.symbolize}}] diff --git a/src/spectator/matchers/have_value_matcher.cr b/src/spectator/matchers/have_value_matcher.cr index 9c722f5..1f3e4a9 100644 --- a/src/spectator/matchers/have_value_matcher.cr +++ b/src/spectator/matchers/have_value_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "has value #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value.has_value?(expected.value) end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not have value #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} has value #{expected.label}" end diff --git a/src/spectator/matchers/inequality_matcher.cr b/src/spectator/matchers/inequality_matcher.cr index 7f175f1..f721ab4 100644 --- a/src/spectator/matchers/inequality_matcher.cr +++ b/src/spectator/matchers/inequality_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is not equal to #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value != actual.value end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is equal to #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is not equal to #{expected.label}" end diff --git a/src/spectator/matchers/less_than_equal_matcher.cr b/src/spectator/matchers/less_than_equal_matcher.cr index 900c7a4..bc56dab 100644 --- a/src/spectator/matchers/less_than_equal_matcher.cr +++ b/src/spectator/matchers/less_than_equal_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "less than or equal to #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value <= expected.value end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is greater than #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is less than or equal to #{expected.label}" end diff --git a/src/spectator/matchers/less_than_matcher.cr b/src/spectator/matchers/less_than_matcher.cr index 5f2ec2c..4e14cd4 100644 --- a/src/spectator/matchers/less_than_matcher.cr +++ b/src/spectator/matchers/less_than_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "less than #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value < expected.value end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is greater than or equal to #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is less than #{expected.label}" end diff --git a/src/spectator/matchers/nil_matcher.cr b/src/spectator/matchers/nil_matcher.cr index 343fe79..5334037 100644 --- a/src/spectator/matchers/nil_matcher.cr +++ b/src/spectator/matchers/nil_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is nil" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value.nil? end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not nil" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is nil" end end diff --git a/src/spectator/matchers/predicate_matcher.cr b/src/spectator/matchers/predicate_matcher.cr index 46d3d94..5c43c60 100644 --- a/src/spectator/matchers/predicate_matcher.cr +++ b/src/spectator/matchers/predicate_matcher.cr @@ -16,7 +16,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is #{expected.label}" end @@ -47,7 +47,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not #{expected.label}" end @@ -58,7 +58,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is #{expected.label}" end diff --git a/src/spectator/matchers/range_matcher.cr b/src/spectator/matchers/range_matcher.cr index 6eba568..32d491f 100644 --- a/src/spectator/matchers/range_matcher.cr +++ b/src/spectator/matchers/range_matcher.cr @@ -7,7 +7,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is in #{expected.label}" end @@ -26,7 +26,7 @@ module Spectator::Matchers end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value.includes?(actual.value) end @@ -36,7 +36,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not in #{expected.label} (#{exclusivity})" end @@ -47,7 +47,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is in #{expected.label} (#{exclusivity})" end diff --git a/src/spectator/matchers/reference_matcher.cr b/src/spectator/matchers/reference_matcher.cr index 633e619..3586e14 100644 --- a/src/spectator/matchers/reference_matcher.cr +++ b/src/spectator/matchers/reference_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value.same?(actual.value) end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is #{expected.label}" end end diff --git a/src/spectator/matchers/respond_matcher.cr b/src/spectator/matchers/respond_matcher.cr index d842167..ce69a7e 100644 --- a/src/spectator/matchers/respond_matcher.cr +++ b/src/spectator/matchers/respond_matcher.cr @@ -9,7 +9,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "responds to #{label}" end diff --git a/src/spectator/matchers/size_matcher.cr b/src/spectator/matchers/size_matcher.cr index 1ab6e3d..d309849 100644 --- a/src/spectator/matchers/size_matcher.cr +++ b/src/spectator/matchers/size_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "has size #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value == actual.value.size end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} does not have #{expected.label} elements" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} has #{expected.label} elements" end diff --git a/src/spectator/matchers/size_of_matcher.cr b/src/spectator/matchers/size_of_matcher.cr index 3e9f1cf..0d7bc30 100644 --- a/src/spectator/matchers/size_of_matcher.cr +++ b/src/spectator/matchers/size_of_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is the same size as #{expected.label}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T expected.value.size == actual.value.size end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not the same size as #{expected.label}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is the same size as #{expected.label}" end diff --git a/src/spectator/matchers/start_with_matcher.cr b/src/spectator/matchers/start_with_matcher.cr index 067f52a..29da717 100644 --- a/src/spectator/matchers/start_with_matcher.cr +++ b/src/spectator/matchers/start_with_matcher.cr @@ -16,7 +16,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "starts with #{expected.label}" end diff --git a/src/spectator/matchers/successful_match_data.cr b/src/spectator/matchers/successful_match_data.cr index 25a94ce..29b11d0 100644 --- a/src/spectator/matchers/successful_match_data.cr +++ b/src/spectator/matchers/successful_match_data.cr @@ -4,7 +4,7 @@ module Spectator::Matchers # Information about a successful match. struct SuccessfulMatchData < MatchData # Indicates that the match succeeded. - def matched? + def matched? : Bool true end end diff --git a/src/spectator/matchers/truthy_matcher.cr b/src/spectator/matchers/truthy_matcher.cr index 34aea3b..df21d8c 100644 --- a/src/spectator/matchers/truthy_matcher.cr +++ b/src/spectator/matchers/truthy_matcher.cr @@ -18,7 +18,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is #{label}" end @@ -83,7 +83,7 @@ module Spectator::Matchers end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T @truthy == !!actual.value end @@ -93,7 +93,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is #{negated_label}" end @@ -104,7 +104,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is #{label}" end diff --git a/src/spectator/matchers/type_matcher.cr b/src/spectator/matchers/type_matcher.cr index 2b44296..4b7aff3 100644 --- a/src/spectator/matchers/type_matcher.cr +++ b/src/spectator/matchers/type_matcher.cr @@ -7,12 +7,12 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "is as #{Expected}" end # Checks whether the matcher is satisifed with the expression given to it. - private def match?(actual : TestExpression(T)) forall T + private def match?(actual : TestExpression(T)) : Bool forall T actual.value.is_a?(Expected) end @@ -22,7 +22,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message(actual) + private def failure_message(actual) : String "#{actual.label} is not a #{Expected}" end @@ -33,7 +33,7 @@ module Spectator::Matchers # # The message should typically only contain the test expression labels. # Actual values should be returned by `#values`. - private def failure_message_when_negated(actual) + private def failure_message_when_negated(actual) : String "#{actual.label} is a #{Expected}" end diff --git a/src/spectator/matchers/unordered_array_matcher.cr b/src/spectator/matchers/unordered_array_matcher.cr index 823ee16..5bbbdf1 100644 --- a/src/spectator/matchers/unordered_array_matcher.cr +++ b/src/spectator/matchers/unordered_array_matcher.cr @@ -14,7 +14,7 @@ module Spectator::Matchers # Short text about the matcher's purpose. # This explains what condition satisfies the matcher. # The description is used when the one-liner syntax is used. - def description + def description : String "contains #{expected.label} in any order" end diff --git a/src/spectator/name_example_filter.cr b/src/spectator/name_example_filter.cr index 8ec6409..a90560c 100644 --- a/src/spectator/name_example_filter.cr +++ b/src/spectator/name_example_filter.cr @@ -6,7 +6,7 @@ module Spectator end # Checks whether the example satisfies the filter. - def includes?(example) + def includes?(example) : Bool @name == example.to_s end end diff --git a/src/spectator/nested_example_group.cr b/src/spectator/nested_example_group.cr index 0a90b86..386b0f4 100644 --- a/src/spectator/nested_example_group.cr +++ b/src/spectator/nested_example_group.cr @@ -23,7 +23,7 @@ module Spectator end # Indicates wheter the group references a type. - def symbolic? + def symbolic? : Bool @what.is_a?(Symbol) end diff --git a/src/spectator/null_example_filter.cr b/src/spectator/null_example_filter.cr index b23e4ac..5a3e036 100644 --- a/src/spectator/null_example_filter.cr +++ b/src/spectator/null_example_filter.cr @@ -2,7 +2,7 @@ module Spectator # Filter that matches all examples. class NullExampleFilter < ExampleFilter # Checks whether the example satisfies the filter. - def includes?(example) + def includes?(example) : Bool true end end diff --git a/src/spectator/pending_example.cr b/src/spectator/pending_example.cr index f485ec4..897b134 100644 --- a/src/spectator/pending_example.cr +++ b/src/spectator/pending_example.cr @@ -5,7 +5,7 @@ module Spectator # This class will not run example code. abstract class PendingExample < Example # Returns a pending result. - private def run_impl + private def run_impl : Result PendingResult.new(self) end end diff --git a/src/spectator/root_example_group.cr b/src/spectator/root_example_group.cr index f169064..65836c3 100644 --- a/src/spectator/root_example_group.cr +++ b/src/spectator/root_example_group.cr @@ -5,12 +5,12 @@ module Spectator # The root has no parent. class RootExampleGroup < ExampleGroup # Dummy value - this should never be used. - def what + def what : Symbol | String "ROOT" end # Indicates that the group is symbolic. - def symbolic? + def symbolic? : Bool true end diff --git a/src/spectator/runnable_example.cr b/src/spectator/runnable_example.cr index 2879cb1..95b1c41 100644 --- a/src/spectator/runnable_example.cr +++ b/src/spectator/runnable_example.cr @@ -8,7 +8,7 @@ module Spectator abstract class RunnableExample < Example # Runs the example, hooks, and captures the result # and translates to a usable result. - def run_impl + def run_impl : Result result = capture_result expectations = Internals::Harness.current.expectations translate_result(result, expectations) diff --git a/src/spectator/source_example_filter.cr b/src/spectator/source_example_filter.cr index 6eaec5f..d3ad4dc 100644 --- a/src/spectator/source_example_filter.cr +++ b/src/spectator/source_example_filter.cr @@ -7,7 +7,7 @@ module Spectator end # Checks whether the example satisfies the filter. - def includes?(example) + def includes?(example) : Bool @source === example.source end end