forked from dagolden/metabase
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed Metabase::Fact::TestFact from tests
Using private Test::Metabase::StringFact from t/lib instead
- Loading branch information
Showing
6 changed files
with
57 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package Test::Metabase::Report; | ||
use 5.006; | ||
use strict; | ||
use warnings; | ||
use base 'Metabase::Report'; | ||
|
||
__PACKAGE__->load_fact_classes; | ||
|
||
sub report_spec { | ||
return { | ||
Test::Metabase::Fact => "1+", # zero or more | ||
} | ||
} | ||
|
||
1; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package Test::Metabase::StringFact; | ||
use 5.006; | ||
use strict; | ||
use warnings; | ||
use base 'Metabase::Fact::String'; | ||
|
||
sub content_metadata { | ||
my $self = shift; | ||
return { | ||
'size' => [ Num => length $self->content ], | ||
}; | ||
} | ||
|
||
sub validate_content { | ||
my $self = shift; | ||
$self->SUPER::validate_content; | ||
die __PACKAGE__ . " content length must be greater than zero\n" | ||
if length $self->content < 0; | ||
} | ||
|
||
1; |
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