-
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.
When making the object, you can now use a path to a file instead of just a string containing URL. Also, more tests.
- Loading branch information
Showing
4 changed files
with
40 additions
and
19 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,4 @@ | ||
*.moarvm | ||
*.swp | ||
lib/.precomp/ | ||
.precomp/ |
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
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,29 @@ | ||
#!/usr/bin/env perl6 | ||
|
||
use Test; | ||
use lib 'lib'; | ||
|
||
use WebService::Slack::webhook; | ||
|
||
#Make some vars | ||
my $fake-url = "https://host.slack.com/example"; | ||
my $file-name = ".slackurl"; | ||
|
||
#Make a bad object. | ||
dies-ok {WebService::Slack::webhook.new()}, | ||
'Bad object fails correctly'; | ||
|
||
#Make a good object with a url. | ||
isa-ok WebService::Slack::webhook.new(url => "$fake-url"), | ||
'WebService::Slack::webhook', | ||
'Good object can be made with url'; | ||
|
||
#Make a good object with a path. | ||
"$file-name".IO.spurt($fake-url); #Make the file. | ||
isa-ok WebService::Slack::webhook.new(path => "$file-name"), | ||
'WebService::Slack::webhook', | ||
'Good object can be made with path'; | ||
"$file-name".IO.unlink; #Remove the file. | ||
|
||
|
||
done-testing; |
This file was deleted.
Oops, something went wrong.