guard-codeception 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -4
  3. data/README.md +19 -9
  4. data/Rakefile +5 -0
  5. data/guard-codeception.gemspec +1 -1
  6. data/lib/guard/codeception.rb +10 -22
  7. data/lib/guard/codeception/runner.rb +44 -0
  8. data/lib/guard/codeception/version.rb +1 -1
  9. data/spec/fixtures/codeception/codeception.yml +18 -0
  10. data/spec/fixtures/codeception/composer.json +18 -0
  11. data/spec/fixtures/codeception/composer.lock +1545 -0
  12. data/spec/fixtures/codeception/index.php +1 -0
  13. data/spec/fixtures/codeception/tests/_bootstrap.php +2 -0
  14. data/spec/fixtures/codeception/tests/_data/dump.sql +1 -0
  15. data/spec/fixtures/codeception/tests/_helpers/CodeHelper.php +8 -0
  16. data/spec/fixtures/codeception/tests/_helpers/TestHelper.php +8 -0
  17. data/spec/fixtures/codeception/tests/_helpers/WebHelper.php +8 -0
  18. data/spec/fixtures/codeception/tests/_log/acceptance-2013-12-28 +19 -0
  19. data/spec/fixtures/codeception/tests/_log/indexCept.php.page.fail.html +1 -0
  20. data/spec/fixtures/codeception/tests/acceptance.suite.yml +18 -0
  21. data/spec/fixtures/codeception/tests/acceptance/WebGuy.php +2061 -0
  22. data/spec/fixtures/codeception/tests/acceptance/_bootstrap.php +2 -0
  23. data/spec/fixtures/codeception/tests/acceptance/indexCept.php +5 -0
  24. data/spec/fixtures/codeception/tests/functional.suite.yml +11 -0
  25. data/spec/fixtures/codeception/tests/functional/TestGuy.php +460 -0
  26. data/spec/fixtures/codeception/tests/functional/_bootstrap.php +2 -0
  27. data/spec/fixtures/codeception/tests/unit.suite.yml +8 -0
  28. data/spec/fixtures/codeception/tests/unit/CodeGuy.php +47 -0
  29. data/spec/fixtures/codeception/tests/unit/_bootstrap.php +2 -0
  30. data/spec/fixtures/results/codeception_failure +29 -0
  31. data/spec/fixtures/results/codeception_success +17 -0
  32. data/spec/guard/codeception/runner_spec.rb +59 -0
  33. data/spec/guard/codeception_spec.rb +32 -14
  34. metadata +66 -17
@@ -0,0 +1,2 @@
1
+ <?php
2
+ // Here you can initialize variables that will for your tests
@@ -0,0 +1,8 @@
1
+ # Codeception Test Suite Configuration
2
+
3
+ # suite for unit (internal) tests.
4
+ # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
5
+
6
+ class_name: CodeGuy
7
+ modules:
8
+ enabled: [CodeHelper]
@@ -0,0 +1,47 @@
1
+ <?php
2
+ // This class was automatically generated by build task
3
+ // You should not change it manually as it will be overwritten on next build
4
+ // @codingStandardsIgnoreFile
5
+
6
+
7
+ use \Codeception\Maybe;
8
+ use Codeception\Module\CodeHelper;
9
+
10
+ /**
11
+ * Inherited methods
12
+ * @method void execute($callable)
13
+ * @method void wantToTest($text)
14
+ * @method void wantTo($text)
15
+ * @method void expectTo($prediction)
16
+ * @method void expect($prediction)
17
+ * @method void amGoingTo($argumentation)
18
+ * @method void am($role)
19
+ * @method void lookForwardTo($achieveValue)
20
+ * @method void offsetGet($offset)
21
+ * @method void offsetSet($offset, $value)
22
+ * @method void offsetExists($offset)
23
+ * @method void offsetUnset($offset)
24
+ */
25
+
26
+ class CodeGuy extends \Codeception\AbstractGuy
27
+ {
28
+
29
+ /**
30
+ * This method is generated.
31
+ * Documentation taken from corresponding module.
32
+ * ----------------------------------------------
33
+ *
34
+ *
35
+ * @see Codeception\Module::getName()
36
+ * @return \Codeception\Maybe
37
+ */
38
+ public function getName() {
39
+ $this->scenario->addStep(new \Codeception\Step\Action('getName', func_get_args()));
40
+ if ($this->scenario->running()) {
41
+ $result = $this->scenario->runStep();
42
+ return new Maybe($result);
43
+ }
44
+ return new Maybe();
45
+ }
46
+ }
47
+
@@ -0,0 +1,2 @@
1
+ <?php
2
+ // Here you can initialize variables that will for your tests
@@ -0,0 +1,29 @@
1
+ Codeception PHP Testing Framework v1.8.1
2
+ Powered by PHPUnit 3.7.28 by Sebastian Bergmann.
3
+
4
+ Acceptance Tests (1) ------------------------
5
+ Running (indexCept.php) Running indexCept.php Fail
6
+ ---------------------------------------------
7
+
8
+ Functional Tests (0) ------------------------
9
+ ---------------------------------------------
10
+
11
+ Unit Tests (0) ------------------------------
12
+ ---------------------------------------------
13
+
14
+
15
+ Time: 153 ms, Memory: 11.75Mb
16
+
17
+ There was 1 failure:
18
+
19
+ ---------
20
+ 1) indexCept.php
21
+ Sorry, I couldn't see "Foo Bar","h2":
22
+ CSS or XPath 'h2' was not found on page.
23
+
24
+ Scenario Steps:
25
+ 2. I see "Foo Bar","h2"
26
+ 1. I am on page "/"
27
+
28
+
29
+ FAILURES!
@@ -0,0 +1,17 @@
1
+ Codeception PHP Testing Framework v1.8.1
2
+ Powered by PHPUnit 3.7.28 by Sebastian Bergmann.
3
+
4
+ Acceptance Tests (1) ------------------------
5
+ Running (indexCept.php) Running indexCept.php Ok
6
+ ---------------------------------------------
7
+
8
+ Functional Tests (0) ------------------------
9
+ ---------------------------------------------
10
+
11
+ Unit Tests (0) ------------------------------
12
+ ---------------------------------------------
13
+
14
+
15
+ Time: 151 ms, Memory: 12.00Mb
16
+
17
+ OK (1 test, 1 assertion)
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+
3
+ describe Guard::Codeception::Runner do
4
+
5
+ let (:default_options) {{
6
+ :test_on_start => false,
7
+ :suites => [:acceptance],
8
+ :groups => [:group1],
9
+ :debug => false,
10
+ :codecept => Dir.getwd + '/spec/fixtures/codeception/vendor/bin/codecept',
11
+ :cli => '-c ' + Dir.getwd + '/spec/fixtures/codeception/codeception.yml'
12
+ }}
13
+
14
+ describe '#run' do
15
+
16
+ # TODO: test #make
17
+
18
+ it 'calls #execute' do
19
+ subject.should_receive(:execute).with(default_options[:codecept] + ' run acceptance -g group1 -c ' + Dir.getwd + '/spec/fixtures/codeception/codeception.yml')
20
+ subject.run default_options
21
+ end
22
+
23
+ it 'calls #codeception_exists?' do
24
+ subject.should_receive(:codeception_exists?)
25
+ subject.run default_options
26
+ end
27
+ end
28
+
29
+ describe '#codeception_exists?' do
30
+
31
+ context 'when codecept not found' do
32
+
33
+ it 'returns false' do
34
+ expect(subject.codeception_exists?('notcodecept')).to be_false
35
+ end
36
+ end
37
+
38
+ it 'returns true' do
39
+ expect(subject.codeception_exists?(default_options[:codecept])).to be_true
40
+ end
41
+ end
42
+
43
+ describe '#make' do
44
+
45
+ it 'returns the command for #system to execute' do
46
+ cmd = subject.make ['codecept', 'run', 'foo,bar']
47
+ expect(cmd).to eq('codecept run foo,bar')
48
+ end
49
+ end
50
+
51
+ describe '#execute' do
52
+
53
+ it 'returns the output from codeception' do
54
+ output = subject.execute default_options[:codecept] + ' run foo,bar'
55
+ output.should_not be_empty
56
+ output.should include 'Codeception PHP Testing Framework'
57
+ end
58
+ end
59
+ end
@@ -2,55 +2,57 @@ require 'spec_helper'
2
2
 
3
3
  describe Guard::Codeception do
4
4
 
5
+ let (:runner) { Guard::Codeception::Runner }
6
+
5
7
  describe '#initialize' do
6
8
 
7
9
  context 'when no options are provided' do
8
10
 
9
11
  it 'has :test_on_start set to false' do
10
- subject.options[:test_on_start].should == false
12
+ expect(subject.options[:test_on_start]).to be_false
11
13
  end
12
14
 
13
15
  it 'has :suites set to [:acceptance, :functional, :unit]' do
14
- subject.options[:suites].should == [:acceptance, :functional, :unit]
16
+ expect(subject.options[:suites]).to match_array([:acceptance, :functional, :unit])
15
17
  end
16
18
 
17
19
  it 'has :debug set to false' do
18
- subject.options[:debug].should == false
20
+ expect(subject.options[:debug]).to be_false
19
21
  end
20
22
 
21
23
  it 'has :groups set to []' do
22
- subject.options[:groups].should == []
24
+ expect(subject.options[:groups]).to match_array([])
23
25
  end
24
26
  end
25
27
 
26
28
  context 'when options are provided' do
27
29
 
28
30
  subject do
29
- Guard::Codeception.new test_on_start: true, suites: [], debug: true, groups: [:foo]
31
+ Guard::Codeception.new test_on_start: true, suites: [:foo], debug: true, groups: [:bar]
30
32
  end
31
33
 
32
34
  it 'has :test_on_start set to true' do
33
- subject.options[:test_on_start].should == true
35
+ expect(subject.options[:test_on_start]).to be_true
34
36
  end
35
37
 
36
38
  it 'has suites set to []' do
37
- subject.options[:suites].should == []
39
+ expect(subject.options[:suites]).to match_array([:foo])
38
40
  end
39
41
 
40
42
  it 'has debug set to true' do
41
- subject.options[:debug].should == true
43
+ expect(subject.options[:debug]).to be_true
42
44
  end
43
45
 
44
- it 'has suites set to [:foo]' do
45
- subject.options[:groups].should == [:foo]
46
+ it 'has groups set to [:foo]' do
47
+ expect(subject.options[:groups]).to match_array([:bar])
46
48
  end
47
49
  end
48
50
  end
49
51
 
50
52
  describe '#start' do
51
53
 
52
- it 'should\'t call #run_all' do
53
- subject.should_not_receive(:run_all)
54
+ it 'should\'t call #run' do
55
+ subject.should_not_receive :run
54
56
  subject.start
55
57
  end
56
58
 
@@ -60,10 +62,26 @@ describe Guard::Codeception do
60
62
  Guard::Codeception.new test_on_start: true
61
63
  end
62
64
 
63
- it 'should call #run_all' do
64
- subject.should_receive(:run)
65
+ it 'should call #run' do
66
+ subject.should_receive :run
65
67
  subject.start
66
68
  end
67
69
  end
68
70
  end
71
+
72
+ describe '#runs_on_change' do
73
+
74
+ it 'should call #run' do
75
+ subject.should_receive :run
76
+ subject.run_on_change []
77
+ end
78
+ end
79
+
80
+ describe '#run' do
81
+
82
+ it 'should call Runner#run' do
83
+ runner.should_receive :run
84
+ subject.run
85
+ end
86
+ end
69
87
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-codeception
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colby Swandale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-15 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.14'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.14'
69
69
  description: Guard gem for codeception
@@ -73,20 +73,45 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .rspec
78
- - .travis.yml
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
79
  - Gemfile
80
80
  - LICENSE.txt
81
81
  - README.md
82
82
  - Rakefile
83
83
  - guard-codeception.gemspec
84
84
  - lib/guard/codeception.rb
85
+ - lib/guard/codeception/runner.rb
85
86
  - lib/guard/codeception/templates/Guardfile
86
87
  - lib/guard/codeception/version.rb
88
+ - spec/fixtures/codeception/codeception.yml
89
+ - spec/fixtures/codeception/composer.json
90
+ - spec/fixtures/codeception/composer.lock
91
+ - spec/fixtures/codeception/index.php
92
+ - spec/fixtures/codeception/tests/_bootstrap.php
93
+ - spec/fixtures/codeception/tests/_data/dump.sql
94
+ - spec/fixtures/codeception/tests/_helpers/CodeHelper.php
95
+ - spec/fixtures/codeception/tests/_helpers/TestHelper.php
96
+ - spec/fixtures/codeception/tests/_helpers/WebHelper.php
97
+ - spec/fixtures/codeception/tests/_log/acceptance-2013-12-28
98
+ - spec/fixtures/codeception/tests/_log/indexCept.php.page.fail.html
99
+ - spec/fixtures/codeception/tests/acceptance.suite.yml
100
+ - spec/fixtures/codeception/tests/acceptance/WebGuy.php
101
+ - spec/fixtures/codeception/tests/acceptance/_bootstrap.php
102
+ - spec/fixtures/codeception/tests/acceptance/indexCept.php
103
+ - spec/fixtures/codeception/tests/functional.suite.yml
104
+ - spec/fixtures/codeception/tests/functional/TestGuy.php
105
+ - spec/fixtures/codeception/tests/functional/_bootstrap.php
106
+ - spec/fixtures/codeception/tests/unit.suite.yml
107
+ - spec/fixtures/codeception/tests/unit/CodeGuy.php
108
+ - spec/fixtures/codeception/tests/unit/_bootstrap.php
109
+ - spec/fixtures/results/codeception_failure
110
+ - spec/fixtures/results/codeception_success
111
+ - spec/guard/codeception/runner_spec.rb
87
112
  - spec/guard/codeception_spec.rb
88
113
  - spec/spec_helper.rb
89
- homepage: http://www.taplaboratories.com.au/guard-codeception
114
+ homepage: https://github.com/colby-swandale/guard-codeception
90
115
  licenses:
91
116
  - MIT
92
117
  metadata: {}
@@ -96,20 +121,44 @@ require_paths:
96
121
  - lib
97
122
  required_ruby_version: !ruby/object:Gem::Requirement
98
123
  requirements:
99
- - - '>='
124
+ - - ">="
100
125
  - !ruby/object:Gem::Version
101
126
  version: '0'
102
127
  required_rubygems_version: !ruby/object:Gem::Requirement
103
128
  requirements:
104
- - - '>='
129
+ - - ">="
105
130
  - !ruby/object:Gem::Version
106
131
  version: '0'
107
132
  requirements: []
108
133
  rubyforge_project:
109
- rubygems_version: 2.1.11
134
+ rubygems_version: 2.2.1
110
135
  signing_key:
111
136
  specification_version: 4
112
137
  summary: guard-codeception automatically runs codeception on file changes
113
138
  test_files:
139
+ - spec/fixtures/codeception/codeception.yml
140
+ - spec/fixtures/codeception/composer.json
141
+ - spec/fixtures/codeception/composer.lock
142
+ - spec/fixtures/codeception/index.php
143
+ - spec/fixtures/codeception/tests/_bootstrap.php
144
+ - spec/fixtures/codeception/tests/_data/dump.sql
145
+ - spec/fixtures/codeception/tests/_helpers/CodeHelper.php
146
+ - spec/fixtures/codeception/tests/_helpers/TestHelper.php
147
+ - spec/fixtures/codeception/tests/_helpers/WebHelper.php
148
+ - spec/fixtures/codeception/tests/_log/acceptance-2013-12-28
149
+ - spec/fixtures/codeception/tests/_log/indexCept.php.page.fail.html
150
+ - spec/fixtures/codeception/tests/acceptance.suite.yml
151
+ - spec/fixtures/codeception/tests/acceptance/WebGuy.php
152
+ - spec/fixtures/codeception/tests/acceptance/_bootstrap.php
153
+ - spec/fixtures/codeception/tests/acceptance/indexCept.php
154
+ - spec/fixtures/codeception/tests/functional.suite.yml
155
+ - spec/fixtures/codeception/tests/functional/TestGuy.php
156
+ - spec/fixtures/codeception/tests/functional/_bootstrap.php
157
+ - spec/fixtures/codeception/tests/unit.suite.yml
158
+ - spec/fixtures/codeception/tests/unit/CodeGuy.php
159
+ - spec/fixtures/codeception/tests/unit/_bootstrap.php
160
+ - spec/fixtures/results/codeception_failure
161
+ - spec/fixtures/results/codeception_success
162
+ - spec/guard/codeception/runner_spec.rb
114
163
  - spec/guard/codeception_spec.rb
115
164
  - spec/spec_helper.rb