Skip to content

Commit

Permalink
Move META generation in test out of DistGen
Browse files Browse the repository at this point in the history
  • Loading branch information
Leont committed Apr 25, 2024
1 parent 6b8c922 commit 1d40677
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
19 changes: 0 additions & 19 deletions t/lib/DistGen.pm
Original file line number Diff line number Diff line change
Expand Up @@ -152,25 +152,6 @@ sub _gen_default_filedata {
use $module_name;
ok 1;
---

$self->$add_unless('META.yml', undent(<<" ----"));
---
name: $dist_name
version: 0.001
author:
- 'David Golden <dagolden\@cpan.org>'
- 'Leon Timmermans <leont\@cpan.org>'
abstract: 'A testing dist'
license: perl
requires:
perl: 5.006
Module::Build::Tiny: 0
generated_by: Leon Timmermans
dynamic_config: 0
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
----
}

sub name { shift()->{name} }
Expand Down
31 changes: 31 additions & 0 deletions t/simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,37 @@ if ($has_compiler) {
return "Hello World!\n";
}
---

$dist->add_file('META.json', undent(<<" ----"));
{
"name": "Foo-Bar",
"version": 0.001,
"author": [
"David Golden <dagolden\@cpan.org>",
"Leon Timmermans <leont\@cpan.org>"
],
"abstract": "A testing dist",
"license": "perl_5",
"prereqs": {
"configure": {
"requires": {
"Module::Build::Tiny": 0
}
},
"runtime": {
"requires": {
"perl": 5.006
}
}
},
"generated_by": "Leon Timmermans",
"dynamic_config": 1,
"meta-spec": {
"url": "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version": 2
}
}
----
}

$dist->regen;
Expand Down

0 comments on commit 1d40677

Please sign in to comment.