-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A few tests have been writen to set constraints and guides. The very beginnings of the module have been writen as well.
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env perl6 | ||
|
||
use Net::HTTP::POST; | ||
use JSON::Fast; | ||
|
||
#Make the class. | ||
class WebService::Slack::webhook { | ||
#Make some vars. | ||
has Str $!url; | ||
|
||
#Make some methods to build the object. | ||
multi method new(Str:D $var) { self.bless(:url($var)); } | ||
multi method new($other?) { die "No Slack integration given!"; } | ||
} |
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,9 @@ | ||
#!/usr/bin/env perl6 | ||
|
||
use Test; | ||
use lib 'lib'; | ||
|
||
#Make sure we can even call it. | ||
use-ok 'WebService::Slack::webhook'; | ||
|
||
done-testing; |
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,18 @@ | ||
#!/usr/bin/env perl6 | ||
|
||
use Test; | ||
use lib 'lib'; | ||
|
||
use WebService::Slack::webhook; | ||
|
||
#Make a bad object. | ||
dies-ok {WebService::Slack::webhook.new()}, | ||
'Bad object fails correctly'; | ||
|
||
#Make a good object. | ||
my $slack = WebService::Slack::webhook.new("https://host.slack.com/example"); | ||
isa-ok $slack, | ||
'WebService::Slack::webhook', | ||
'Good object can be made'; | ||
|
||
done-testing; |