Commits

Toby Inkster  committed 471a3b1

s/assertion/assertions/

  • Participants
  • Parent commits 2127964

Comments (0)

Files changed (2)

File lib/Types/XSD.pm

 our @patterns;   my $pattern_i = -1;
 our @assertions; my $assertion_i = -1;
 my %facets = (
-	assertion => sub {
+	assertions => sub {
 		my ($o, $var) = @_;
-		return unless exists $o->{assertion};
-		my $ass = delete $o->{assertion};
+		return unless exists $o->{assertions};
+		my $ass = delete $o->{assertions};
 		$ass = [$ass] unless ref($ass) eq q(ARRAY);
 		my @r;
 		for my $a (@$ass)
 sub facet
 {
 	my $self   = pop;
-	my @facets = ("assertion", @_);
+	my @facets = ("assertions", @_);
 	my $regexp = qr{^${\(join "|", map quotemeta, @facets)}$}ms;
 	my $name   = "$self";
 	

File t/02datetimes.t

 should_fail('2009-02-12T03:54:00', DateTime[explicitTimezone => "required"]);
 should_pass('2009-02-12T03:54:00', DateTime[explicitTimezone => "prohibited"]);
 
-should_pass('2009-02-12T03:54:00', DateTime[assertion => sub { m/^2009/ }]);
-should_pass('2009-02-12T03:54:00', DateTime[assertion => 'm/^2009/']);
-should_fail('2010-02-12T03:54:00', DateTime[assertion => sub { m/^2009/ }]);
-should_fail('2010-02-12T03:54:00', DateTime[assertion => 'm/^2009/']);
+should_pass('2009-02-12T03:54:00', DateTime[assertions => sub { m/^2009/ }]);
+should_pass('2009-02-12T03:54:00', DateTime[assertions => 'm/^2009/']);
+should_fail('2010-02-12T03:54:00', DateTime[assertions => sub { m/^2009/ }]);
+should_fail('2010-02-12T03:54:00', DateTime[assertions => 'm/^2009/']);
 
-should_pass('2009-02-12T03:54:00', DateTime[assertion => [sub { m/^2009/ }, 'm/-02-/']]);
+should_pass('2009-02-12T03:54:00', DateTime[assertions => [sub { m/^2009/ }, 'm/-02-/']]);
 
 done_testing;