Files
perl-Test-Roo/perl-Test-Roo.spec
2025-08-12 18:17:53 +02:00

101 lines
3.5 KiB
RPMSpec

#
# spec file for package perl-Test-Roo
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name Test-Roo
Name: perl-Test-Roo
Version: 1.4.0
Release: 0
# 1.004 -> normalize -> 1.4.0
%define cpan_version 1.004
License: Apache-2.0
Summary: Composable, reusable tests with roles and Moo
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Capture::Tiny) >= 0.12
BuildRequires: perl(Moo) >= 1.000008
BuildRequires: perl(MooX::Types::MooseLike::Base)
BuildRequires: perl(Sub::Install)
BuildRequires: perl(Test::More) >= 0.96
BuildRequires: perl(strictures)
Requires: perl(Moo) >= 1.000008
Requires: perl(MooX::Types::MooseLike::Base)
Requires: perl(Sub::Install)
Requires: perl(Test::More) >= 0.96
Requires: perl(strictures)
Provides: perl(Test::Roo) = %{version}
Provides: perl(Test::Roo::Class) = %{version}
Provides: perl(Test::Roo::Cookbook) = %{version}
Provides: perl(Test::Roo::Role) = %{version}
%undefine __perllib_provides
Recommends: perl(bareword::filehandles)
Recommends: perl(indirect)
Recommends: perl(multidimensional)
%{perl_requires}
%description
This module allows you to compose Test::More tests from roles. It is
inspired by the excellent Test::Routine module, but uses Moo instead of
Moose. This gives most of the benefits without the need for Moose as a test
dependency.
Test files are Moo classes. You can define any needed test fixtures as Moo
attributes. You define tests as method modifiers -- similar in concept to
'subtest' in Test::More, but your test method will be passed the test
object for access to fixture attributes. You may compose any Moo::Role into
your test to define attributes, require particular methods, or define
tests.
This means that you can isolate test _behaviors_ into roles which require
certain test _fixtures_ in order to run. Your main test file will provide
the fixtures and compose the roles to run. This makes it easy to reuse test
behaviors.
For example, if you are creating tests for Awesome::Module, you could
create the test behaviors as Awesome::Module::Test::Role and distribute it
with your module. If another distribution subclasses Awesome::Module, it
can compose the Awesome::Module::Test::Role behavior for its own tests.
No more copying and pasting tests from a super class! Superclasses define
and share their tests. Subclasses provide their own fixtures and run the
tests.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes CONTRIBUTING.mkdn examples README
%license LICENSE
%changelog