-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Add some basic tests
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 3; | ||
use App::LinkSite; | ||
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.24 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.24 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.26 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.26 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.28 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.28 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.32 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.32 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.36 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.36 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.34 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.34 on ubuntu-latest
Check failure on line 4 in t/basic.t GitHub Actions / test / Perl 5.30 on macos-latest
|
||
|
||
# Test the creation of an App::LinkSite object | ||
my $linksite = App::LinkSite->new(); | ||
isa_ok($linksite, 'App::LinkSite', 'Created an App::LinkSite object'); | ||
|
||
# Test the src method | ||
is($linksite->src, 'src', 'src method returns "src"'); | ||
|
||
# Test the out method | ||
is($linksite->out, 'docs', 'out method returns "docs"'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 5; | ||
use App::LinkSite::Link; | ||
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.24 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.24 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.26 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.26 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.28 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.28 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.32 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.32 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.36 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.36 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.34 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.34 on ubuntu-latest
Check failure on line 4 in t/link.t GitHub Actions / test / Perl 5.30 on macos-latest
|
||
|
||
# Test the creation of an App::LinkSite::Link object | ||
my $link = App::LinkSite::Link->new( | ||
title => 'Test Title', | ||
subtitle => 'Test Subtitle', | ||
link => 'http://example.com', | ||
new_link => 1, | ||
); | ||
isa_ok($link, 'App::LinkSite::Link', 'Created an App::LinkSite::Link object'); | ||
|
||
# Test the title method | ||
is($link->title, 'Test Title', 'title method returns "Test Title"'); | ||
|
||
# Test the subtitle method | ||
is($link->subtitle, 'Test Subtitle', 'subtitle method returns "Test Subtitle"'); | ||
|
||
# Test the link method | ||
is($link->link, 'http://example.com', 'link method returns "http://example.com"'); | ||
|
||
# Test the is_new method | ||
is($link->is_new, 1, 'is_new method returns 1'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 7; | ||
use App::LinkSite::Site; | ||
|
||
# Test the creation of an App::LinkSite::Site object | ||
my $site = App::LinkSite::Site->new( | ||
name => 'Test Name', | ||
handle => 'Test Handle', | ||
image => 'test_image.jpg', | ||
desc => 'Test Description', | ||
og_image => 'test_og_image.png', | ||
site_url => 'http://example.com', | ||
); | ||
isa_ok($site, 'App::LinkSite::Site', 'Created an App::LinkSite::Site object'); | ||
|
||
# Test the name method | ||
is($site->name, 'Test Name', 'name method returns "Test Name"'); | ||
|
||
# Test the handle method | ||
is($site->handle, 'Test Handle', 'handle method returns "Test Handle"'); | ||
|
||
# Test the image method | ||
is($site->image, 'test_image.jpg', 'image method returns "test_image.jpg"'); | ||
|
||
# Test the desc method | ||
is($site->desc, 'Test Description', 'desc method returns "Test Description"'); | ||
|
||
# Test the og_image method | ||
is($site->og_image, 'test_og_image.png', 'og_image method returns "test_og_image.png"'); | ||
|
||
# Test the site_url method | ||
is($site->site_url, 'http://example.com', 'site_url method returns "http://example.com"'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 4; | ||
use App::LinkSite::Social; | ||
|
||
# Test the creation of an App::LinkSite::Social object | ||
my $social = App::LinkSite::Social->new( | ||
service => 'twitter', | ||
handle => 'test_handle', | ||
url => 'http://example.com', | ||
); | ||
isa_ok($social, 'App::LinkSite::Social', 'Created an App::LinkSite::Social object'); | ||
|
||
# Test the service method | ||
is($social->service, 'twitter', 'service method returns "twitter"'); | ||
|
||
# Test the handle method | ||
is($social->handle, 'test_handle', 'handle method returns "test_handle"'); | ||
|
||
# Test the url method | ||
is($social->url, 'http://example.com', 'url method returns "http://example.com"'); |