100 lines
3.0 KiB
RPMSpec
100 lines
3.0 KiB
RPMSpec
#
|
|
# spec file for package perl-Test-Deep-UnorderedPairs
|
|
#
|
|
# 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-Deep-UnorderedPairs
|
|
Name: perl-Test-Deep-UnorderedPairs
|
|
Version: 0.6.0
|
|
Release: 0
|
|
# 0.006 -> normalize -> 0.6.0
|
|
%define cpan_version 0.006
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
|
Summary: Test::Deep plugin for comparing an unordered list of tuples
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{cpan_version}.tar.gz
|
|
Source100: README.md
|
|
BuildArch: noarch
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
BuildRequires: perl(Test::Deep)
|
|
BuildRequires: perl(Test::Deep::ArrayLength)
|
|
BuildRequires: perl(Test::Deep::Cmp)
|
|
BuildRequires: perl(Test::Deep::Set)
|
|
BuildRequires: perl(Test::Fatal)
|
|
BuildRequires: perl(Test::More) >= 0.88
|
|
BuildRequires: perl(parent)
|
|
Requires: perl(Test::Deep::ArrayLength)
|
|
Requires: perl(Test::Deep::Cmp)
|
|
Requires: perl(Test::Deep::Set)
|
|
Requires: perl(parent)
|
|
Provides: perl(Test::Deep::UnorderedPairs) = %{version}
|
|
%undefine __perllib_provides
|
|
%{perl_requires}
|
|
|
|
%description
|
|
This module provides the sub 'unordered_pairs' (and 'tuples', 'samehash',
|
|
as synonyms) to indicate the data being tested is a list of pairs that
|
|
should be tested where the order of the pairs is insignificant.
|
|
|
|
This is useful when testing a function that returns a list of hash elements
|
|
as an arrayref, not a hashref. One such application might be testing PSGI
|
|
headers, which are passed around as an arrayref:
|
|
|
|
my $response = [
|
|
'200',
|
|
[
|
|
'Content-Length' => '12',
|
|
'Content-Type' => 'text/plain',
|
|
],
|
|
[ 'hello world!' ],
|
|
];
|
|
|
|
# this test passes
|
|
cmp_deeply(
|
|
$response,
|
|
[
|
|
'200',
|
|
unordered_pairs(
|
|
'Content-Type' => 'text/plain',
|
|
'Content-Length' => '12',
|
|
],
|
|
[ 'hello world!' ],
|
|
],
|
|
'check headers as an arrayref of unordered pairs',
|
|
);
|
|
|
|
%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 examples README
|
|
%license LICENCE
|
|
|
|
%changelog
|