From 36c98db0ae090ea01fe0d8adf7d4d86f804177f5 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 14 Feb 2019 15:41:59 -0700 Subject: [PATCH] Update spec helpers to have source information --- spec/helpers/errored_example.cr | 10 ++++++++++ spec/helpers/failing_example.cr | 10 ++++++++++ spec/helpers/passing_example.cr | 10 ++++++++++ spec/helpers/spy_example.cr | 10 ++++++++++ spec/pending_example_spec.cr | 8 ++++++++ 5 files changed, 48 insertions(+) diff --git a/spec/helpers/errored_example.cr b/spec/helpers/errored_example.cr index 79a93bf..bd71bb4 100644 --- a/spec/helpers/errored_example.cr +++ b/spec/helpers/errored_example.cr @@ -5,6 +5,16 @@ class ErroredExample < Spectator::RunnableExample "ERROR" end + # Dummy source file. + def source_file + __FILE__ + end + + # Dummy source line number. + def source_line + __LINE__ + end + # Dummy instance. def instance nil diff --git a/spec/helpers/failing_example.cr b/spec/helpers/failing_example.cr index ac66fbb..db07310 100644 --- a/spec/helpers/failing_example.cr +++ b/spec/helpers/failing_example.cr @@ -5,6 +5,16 @@ class FailingExample < Spectator::RunnableExample "FAIL" end + # Dummy source file. + def source_file + __FILE__ + end + + # Dummy source line number. + def source_line + __LINE__ + end + # Dummy instance. def instance nil diff --git a/spec/helpers/passing_example.cr b/spec/helpers/passing_example.cr index 4e01bac..0061fc3 100644 --- a/spec/helpers/passing_example.cr +++ b/spec/helpers/passing_example.cr @@ -5,6 +5,16 @@ class PassingExample < Spectator::RunnableExample "PASS" end + # Dummy source file. + def source_file + __FILE__ + end + + # Dummy source line number. + def source_line + __LINE__ + end + # Dummy instance. def instance nil diff --git a/spec/helpers/spy_example.cr b/spec/helpers/spy_example.cr index f264478..0d77df4 100644 --- a/spec/helpers/spy_example.cr +++ b/spec/helpers/spy_example.cr @@ -6,6 +6,16 @@ class SpyExample < Spectator::RunnableExample "SPY" end + # Dummy source file. + def source_file + __FILE__ + end + + # Dummy source line number. + def source_line + __LINE__ + end + # Dummy instance. def instance nil diff --git a/spec/pending_example_spec.cr b/spec/pending_example_spec.cr index 005d098..0991359 100644 --- a/spec/pending_example_spec.cr +++ b/spec/pending_example_spec.cr @@ -5,6 +5,14 @@ class ConcretePendingExample < Spectator::PendingExample "PENDING_TEST_EXAMPLE" end + def source_file + __FILE__ + end + + def source_line + __LINE__ + end + def instance nil end