summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-phpspec.spec25
-rw-r--r--phpspec-autoload.php11
-rw-r--r--phpspec-rpm.patch12
3 files changed, 29 insertions, 19 deletions
diff --git a/php-phpspec.spec b/php-phpspec.spec
index c691df1..8b7b006 100644
--- a/php-phpspec.spec
+++ b/php-phpspec.spec
@@ -6,15 +6,15 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 66a1df93099282b1514e9e001fcf6e9393f7783d
+%global gh_commit 9727d75919a00455433e867565bc022f0b985a39
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner phpspec
%global gh_project phpspec
Name: php-phpspec
-Version: 2.1.1
+Version: 2.2.0
Release: 1%{?dist}
-Summary: Specification-oriented BDD framework for PHP 5.3+
+Summary: Specification-oriented BDD framework for PHP
Group: Development/Libraries
License: MIT
@@ -29,7 +29,7 @@ Patch0: %{gh_project}-rpm.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: %{_bindir}/phpunit
-BuildRequires: php-composer(phpspec/prophecy) >= 1.1
+BuildRequires: php-composer(phpspec/prophecy) >= 1.4
BuildRequires: php-composer(phpspec/php-diff) >= 1.0.0
BuildRequires: php-composer(sebastian/exporter) >= 1.0
BuildRequires: php-composer(symfony/console) >= 2.3.0
@@ -44,7 +44,7 @@ BuildRequires: php-composer(symfony/filesystem) >= 2.1
# From composer.json, require
# "php": ">=5.3.3",
-# "phpspec/prophecy": "~1.1",
+# "phpspec/prophecy": "~1.4",
# "phpspec/php-diff": "~1.0.0",
# "sebastian/exporter": "~1.0",
# "symfony/console": "~2.3",
@@ -52,9 +52,9 @@ BuildRequires: php-composer(symfony/filesystem) >= 2.1
# "symfony/finder": "~2.1",
# "symfony/process": "~2.1",
# "symfony/yaml": "~2.1",
-# "doctrine/instantiator": "~1.0,>=1.0.1"
+# "doctrine/instantiator": "^1.0.1"
Requires: php(language) >= 5.3.3
-Requires: php-composer(phpspec/prophecy) >= 1.1
+Requires: php-composer(phpspec/prophecy) >= 1.4
Requires: php-composer(phpspec/prophecy) < 2
Requires: php-composer(phpspec/php-diff) >= 1.0.0
Requires: php-composer(phpspec/php-diff) < 2
@@ -121,11 +121,16 @@ install -Dpm755 bin/phpspec %{buildroot}%{_bindir}/phpspec
%check
+export LANG=en_GB.utf8
%{_bindir}/php \
- -d include_path=.:%{buildroot}%{_datadir}/php:/usr/share/php \
+ -d include_path=.:src:/usr/share/php \
bin/phpspec \
run --format pretty --verbose --no-ansi
+%{_bindir}/phpunit \
+ --verbose \
+ --bootstrap src/PhpSpec/autoload.php
+
%clean
rm -rf %{buildroot}
@@ -142,5 +147,9 @@ rm -rf %{buildroot}
%changelog
+* Sun Apr 19 2015 Remi Collet <remi@fedoraproject.org> - 2.2.0-1
+- update to 2.2.0
+- raise dependency on phpspec/prophecy 1.4
+
* Tue Feb 17 2015 Remi Collet <remi@fedoraproject.org> - 2.1.1-1
- initial package \ No newline at end of file
diff --git a/phpspec-autoload.php b/phpspec-autoload.php
index fff41bc..47f19c5 100644
--- a/phpspec-autoload.php
+++ b/phpspec-autoload.php
@@ -1,5 +1,7 @@
<?php
+/* not namespaced, use classs-map */
require_once 'phpspec/php-diff/autoload.php';
+/* prophecy and its dependencies */
require_once 'Prophecy/autoload.php';
$vendorDir = '/usr/share/php';
@@ -7,10 +9,15 @@ require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.p
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
-$loader->registerNamespaces(array(
+$ns = array(
'Doctrine\\Instantiator' => $vendorDir,
'SebastianBergmann' => $vendorDir,
'Symfony\\Component' => $vendorDir,
'PhpSpec' => dirname(__DIR__),
-));
+);
+/* spec tree in current dir, when exists */
+if (is_dir(getcwd().'/spec')) {
+ $ns['spec'] = getcwd();
+}
+$loader->registerNamespaces($ns);
$loader->register();
diff --git a/phpspec-rpm.patch b/phpspec-rpm.patch
index 8daf1ef..d239a38 100644
--- a/phpspec-rpm.patch
+++ b/phpspec-rpm.patch
@@ -1,12 +1,6 @@
-diff -up bin/phpspec.rpm bin/phpspec
---- bin/phpspec.rpm 2015-01-09 14:21:45.000000000 +0100
-+++ bin/phpspec 2015-02-17 15:18:53.913872436 +0100
-@@ -1,26 +1,13 @@
--#!/usr/bin/env php
-+#!/usr/bin/php
- <?php
-
- define('PHPSPEC_VERSION', '2.1.1');
+--- bin/phpspec.rpm 2015-04-19 06:39:34.900178171 +0200
++++ bin/phpspec 2015-04-19 06:41:59.521743839 +0200
+@@ -5,22 +5,9 @@
-if (is_file($autoload = getcwd() . '/vendor/autoload.php')) {
- require $autoload;