Akron | 8f8deda | 2021-01-15 12:55:06 +0100 | [diff] [blame] | 1 | use Mojo::Base -strict; |
| 2 | use Test::More; |
| 3 | use Test::Mojo; |
| 4 | |
| 5 | our %ENV; |
| 6 | |
| 7 | my $app = Test::Mojo->new('Kalamar')->app; |
| 8 | is($app->korap->api, 'https://korap.ids-mannheim.de/api/v1.0/'); |
| 9 | |
| 10 | |
| 11 | $ENV{KALAMAR_API} = 'https://example.com/'; |
| 12 | $app = Test::Mojo->new('Kalamar')->app; |
| 13 | is($app->korap->api, 'https://example.com/v1.0/'); |
| 14 | |
| 15 | $app = Test::Mojo->new('Kalamar' => { |
| 16 | Kalamar => { |
| 17 | api_path => 'https://example.org/' |
| 18 | } |
| 19 | })->app; |
| 20 | is($app->korap->api, 'https://example.org/v1.0/'); |
| 21 | |
| 22 | $ENV{KALAMAR_API} = undef; |
| 23 | $app = Test::Mojo->new('Kalamar' => { |
| 24 | Kalamar => { |
| 25 | api_version => '1.1' |
| 26 | } |
| 27 | })->app; |
| 28 | is($app->korap->api, 'https://korap.ids-mannheim.de/api/v1.1/'); |
| 29 | |
| 30 | |
| 31 | done_testing; |
| 32 | __END__ |