Skip to content

Commit

Permalink
v0.049
Browse files Browse the repository at this point in the history
	* Add definition_context_ok()
  • Loading branch information
rsrchboy committed Jul 30, 2017
1 parent e770325 commit 04ac8f9
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 47 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Revision history for Test-Moose-More

{{$NEXT}}

0.049-TRIAL 2017-07-30 13:27:51 CDT-0500
* Add definition_context_ok()

0.048 2017-06-17 23:19:13 CDT-0500
Expand Down
101 changes: 54 additions & 47 deletions README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Test::Moose::More - More tools for testing Moose packages

# VERSION

This document describes version 0.049 of Test::Moose::More - released July 25, 2017 as part of Test-Moose-More.
This document describes version 0.049 of Test::Moose::More - released July 30, 2017 as part of Test-Moose-More.

# SYNOPSIS

Expand Down Expand Up @@ -126,6 +126,11 @@ accessor -- that is, it descends from [Class::MOP::Method::Accessor](https://met
Given a thing (role, class, etc) and a method, test that the method is **not**
an accessor -- that is, it does not descend from [Class::MOP::Method::Accessor](https://metacpan.org/pod/Class::MOP::Method::Accessor).

## definition\_context\_ok $meta, \\%dc

Validates the definition context of a metaclass instance. This is a strict
comparison.

## role\_wraps\_around\_method\_ok $role, @methods

Queries `$role`'s metaclass to see if `$role` wraps the methods named in
Expand Down Expand Up @@ -249,6 +254,54 @@ or "let's subclass Moose::Meta::Class/etc and implement something new").
As with ["does\_metaroles\_ok"](#does_metaroles_ok), but test that the metaroles are not consumed, a
la ["does\_not\_ok"](#does_not_ok).

## attribute\_options\_ok

Validates that an attribute is set up as expected; like
`validate_attribute()`, but only concerns itself with attribute options.

Note that some of these options will skip if used against attributes defined
in a role.

- `-subtest => 'subtest name...'`

If set, all tests run (save the first, "does this thing even have this
attribute?" test) will be wrapped in a subtest, the name of which will be
whatever `-subtest` is set to.

- `is => ro|rw`

Tests for reader/writer options set as one would expect.

- `isa => ...`

Validates that the attribute requires its value to be a given type.

- `does => ...`

Validates that the attribute requires its value to do a given role.

- `builder => '...'`

Validates that the attribute expects the method name given to be its builder.

- `default => ...`

Validates that the attribute has the given default.

- `init_arg => '...'`

Validates that the attribute has the given initial argument name.

- `lazy => 0|1`

Validates that the attribute is/isn't lazy.

- `required => 0|1`

Validates that setting the attribute's value is/isn't required.

# VALIDATION METHODS

## validate\_thing

Runs a bunch of tests against the given `$thing`, as defined:
Expand Down Expand Up @@ -590,52 +643,6 @@ the following:
If set, all tests run will be wrapped in a subtest, the name of which will be
whatever `-subtest` is set to.

## attribute\_options\_ok

Validates that an attribute is set up as expected; like
`validate_attribute()`, but only concerns itself with attribute options.

Note that some of these options will skip if used against attributes defined
in a role.

- `-subtest => 'subtest name...'`

If set, all tests run (save the first, "does this thing even have this
attribute?" test) will be wrapped in a subtest, the name of which will be
whatever `-subtest` is set to.

- `is => ro|rw`

Tests for reader/writer options set as one would expect.

- `isa => ...`

Validates that the attribute requires its value to be a given type.

- `does => ...`

Validates that the attribute requires its value to do a given role.

- `builder => '...'`

Validates that the attribute expects the method name given to be its builder.

- `default => ...`

Validates that the attribute has the given default.

- `init_arg => '...'`

Validates that the attribute has the given initial argument name.

- `lazy => 0|1`

Validates that the attribute is/isn't lazy.

- `required => 0|1`

Validates that setting the attribute's value is/isn't required.

# SEE ALSO

Please see those modules/websites for more information related to this module.
Expand Down

0 comments on commit 04ac8f9

Please sign in to comment.