Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add new test file for required attributes
  • Loading branch information
coke committed Jun 23, 2015
1 parent 66b3dd6 commit 107f8c4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions S12-class/attributes-required.t
@@ -0,0 +1,19 @@
use v6;

use Test;

plan 3;

class fish {
has $.x is required;
}

throws-like { fish.new() }, X::Attribute::Required, "required attributes unset die";
lives-ok { fish.new(:x(3)) }, "Passing in a value, no exception";

class lemur {
has $.x;
}

lives-ok { lemur.new() }, "Non-required attributes aren't";

0 comments on commit 107f8c4

Please sign in to comment.