Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Facter::Util::Values converted and unit tested

  • Loading branch information...
commit 3645cc2661fe35d9905337b0c567df2440b48956 1 parent 3138924
@cosimo authored
Showing with 21 additions and 2 deletions.
  1. +2 −2 lib/Facter/Util/Values.pm
  2. +19 −0 t/values.t
View
4 lib/Facter/Util/Values.pm
@@ -10,9 +10,9 @@ A util module for facter containing helper methods
=end pod
-module Facter::Util::Values {
+class Facter::Util::Values {
- sub convert ($value) {
+ method convert ($value) {
# value = value.to_s if value.is_a?(Symbol)
# value = value.downcase if value.is_a?(String)
$value.Str.lc;
View
19 t/values.t
@@ -0,0 +1,19 @@
+use v6;
+use Test;
+use Facter::Util::Values;
+
+my @values = (
+ 'ABC123', 'abc123',
+ '123', '123',
+ 'xyz', 'xyz',
+);
+
+for @values -> $test_case, $expected_result {
+ is(
+ Facter::Util::Values.convert($test_case), $expected_result,
+ "convert() of String '$test_case' holds '$expected_result'",
+ );
+}
+
+done_testing;
+
Please sign in to comment.
Something went wrong with that request. Please try again.