cuke4php 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.4
1
+ 0.9.5
data/cuke4php.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cuke4php}
8
- s.version = "0.9.4"
8
+ s.version = "0.9.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kevin Olbrich", "Alessandro Dal Grande"]
12
- s.date = %q{2011-03-23}
12
+ s.date = %q{2011-03-27}
13
13
  s.default_executable = %q{cuke4php}
14
14
  s.description = %q{Using this protocol it is possible to directly interact with PHP code at any level without the need for a web server. To accomplish this, when cucumber is running against a directory containing feature files and it cannot resolve a particular step definition, it will ask a known wire server (as defined in a .wire file) to interpret and run those steps.}
15
15
  s.email = ["kevin.olbrich+cuke4php@gmail.com", "aledalgrande@gmail.com"]
@@ -42,4 +42,14 @@ Scenario: I unset a property
42
42
  Scenario: I try to read a property that was not set first
43
43
  Given "Foo" should not be set
44
44
  Then getting "Foo" should raise an "PHPUnit_Framework_Error"
45
-
45
+
46
+ @wire
47
+ Scenario: Before callbacks
48
+ Given some setup
49
+ Then "beforeAll" should be set
50
+ And "beforeWire" should be set
51
+
52
+ Scenario: Before callbacks for untagged scenario
53
+ Given some setup
54
+ Then "beforeAll" should be set
55
+ And "beforeWire" should not be set
@@ -11,18 +11,30 @@ class WireSteps extends CucumberSteps {
11
11
  * @wire
12
12
  */
13
13
  function beforeWire() {
14
- $this->before = 'beforeWire';
14
+ $this->beforeWire = true;
15
15
  }
16
16
 
17
17
  function beforeAll() {
18
+ $this->beforeAll = true;
19
+ }
18
20
 
21
+ /**
22
+ * @wire
23
+ */
24
+ function afterWire() {
25
+ $this->afterWire = true;
19
26
  }
20
27
 
28
+ function afterAll() {
29
+ $this->afterAll = true;
30
+ }
31
+
32
+
21
33
  /**
22
34
  * Given /^some setup$/
23
35
  **/
24
36
  public function stepSomeSetup() {
25
-
37
+ $this->setup = "true";
26
38
  }
27
39
 
28
40
  /**
@@ -67,7 +67,7 @@ class CucumberSteps extends PHPUnit_Framework_Assert {
67
67
  * Get an instance of a hook which is either a pre-set mock,
68
68
  * or an instance of the appropriate step class with the globals initialized
69
69
  */
70
- static function getInstance($sClass, $aGlobals) {
70
+ static function getInstance($sClass, &$aGlobals) {
71
71
  if (array_key_exists($sClass, self::$aMocks) && self::$aMocks[$sClass]) {
72
72
  return self::$aMocks[$sClass];
73
73
  } else {
@@ -83,7 +83,7 @@ class CucumberSteps extends PHPUnit_Framework_Assert {
83
83
  if (array_key_exists($sName, $this->aGlobals)) {
84
84
  return $this->aGlobals[$sName];
85
85
  } else {
86
- trigger_error("Property ($sName) not defined", E_USER_ERROR);
86
+ trigger_error("Property ($sName) not defined... can be one of [" . implode(",",array_keys($this->aGlobals)) . "]", E_USER_ERROR);
87
87
  }
88
88
  }
89
89
 
data/lib/Cuke4Php.php CHANGED
@@ -68,6 +68,8 @@ class Cuke4Php {
68
68
  preg_match("/(@.+)/im", $sComment, $aMatches);
69
69
  if (array_key_exists(1, $aMatches)) {
70
70
  $aMethod['tags'] = explode(" ", str_replace("@", "", $aMatches[1]));
71
+ } else {
72
+ $aMethod['tags'] = array();
71
73
  }
72
74
  if (substr($oMethod->name, 0, 6) === "before") {
73
75
  $this->aWorld['before'][] = $aMethod;
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke4php
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 4
10
- version: 0.9.4
9
+ - 5
10
+ version: 0.9.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kevin Olbrich
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-03-23 00:00:00 -04:00
19
+ date: 2011-03-27 00:00:00 -04:00
20
20
  default_executable: cuke4php
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency