guard-codeception 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f8bec541b520a1e99154badd3b10185ff1663ca1
4
+ data.tar.gz: 4ad19063128933364a7dfe7ec11af275024ac413
5
+ SHA512:
6
+ metadata.gz: cd08783dcc5882c830b0211c1bc1fbc4c756efefd8fc78250681652a48180e18c12612baba88f3be977aa705741b273991c2ba1cf6afc2a3a27caa59091c04d4
7
+ data.tar.gz: 45b438af08c61f52666847bc25f8007ead7a7cf3243c514d2dba502db97afb4b64d4b0b50a3fb95d083a6c47f9b78d889a34e92e1b2fd48395602fe819dc0a4f
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - ree
6
+ - rbx
7
+ notifications:
8
+ email:
9
+ - colby@taplaboratories.com.au
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in guard-codeception.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Colby Swandale
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # TODO:
2
+ - 100% code coverage
3
+
4
+ # Guard::Codeception
5
+
6
+ Guard::Codeception is an extension to the [guard gem](http://guardgem.org/) for the [codeception](http://codeception.com/) testing framework
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'guard-codeception'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ ## Example Guardfle
19
+
20
+ ```ruby
21
+ guard 'codeception' do
22
+ watch(%r{^.*\.php$})
23
+ end
24
+ ```
25
+
26
+ ## Configuration
27
+ The following options can be passed to Guard::Codeception
28
+
29
+ ```ruby
30
+ :suites => [:acceptence, :custom_suite] # run only specified suites
31
+ # default: [:acceptance, :functional, :unit]
32
+
33
+ :groups => [:foo, :bar] # run specific test group
34
+ # default: []
35
+
36
+ :debug => false # enable codeception debug mode
37
+ # default: false
38
+
39
+ :test_on_start => false # run tests when guard starts
40
+ # default: false
41
+ ```
42
+
43
+ ## Usage
44
+ - Make sure you have codeception installed in your project via [composer](http://getcomposer.org/)
45
+ - Create Guardfile, see example above
46
+
47
+ ```bash
48
+ $ guard
49
+ ```
50
+
51
+ ## Contributing
52
+
53
+ 1. Fork it
54
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
55
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
56
+ 4. Push to the branch (`git push origin my-new-feature`)
57
+ 5. Create new Pull Request
58
+
59
+ ## Author
60
+
61
+ [Colby Swandale](https://github.com/colby-swandale)
62
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'guard/codeception/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'guard-codeception'
8
+ spec.version = Guard::CodeceptionVersion::VERSION
9
+ spec.authors = ['Colby Swandale']
10
+ spec.email = ['colby@taplaboratories.com.au']
11
+ spec.description = %q{Guard gem for codeception}
12
+ spec.summary = %q{guard-codeception automatically runs codeception on file changes}
13
+ spec.homepage = 'http://www.taplaboratories.com.au/guard-codeception'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'guard', '>= 1.1.0'
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'rake'
24
+ spec.add_development_dependency 'rspec', '~> 2.14'
25
+ end
@@ -0,0 +1,3 @@
1
+ guard 'codeception' do
2
+ watch(%r{^.*\.php$})
3
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module CodeceptionVersion
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,47 @@
1
+ require 'guard'
2
+ require 'guard/plugin'
3
+
4
+ module Guard
5
+ class Codeception < Plugin
6
+
7
+ DEFAULT_OPTIONS = {
8
+ :test_on_start => false,
9
+ :suites => [:acceptance, :functional, :unit],
10
+ :debug => false,
11
+ :groups => []
12
+ }
13
+
14
+ def initialize(options = {})
15
+ @options = DEFAULT_OPTIONS.merge(options)
16
+ super(@options)
17
+ end
18
+
19
+ def start
20
+ puts run if options[:test_on_start]
21
+ end
22
+
23
+ def run_on_change(paths)
24
+ puts run
25
+ end
26
+
27
+ def run
28
+ cmd = []
29
+ cmd << "vendor/bin/codecept"
30
+ cmd << "run"
31
+ cmd << options[:suites].join(',')
32
+ cmd << '-g ' + options[:groups].join(' -g ') if !options[:groups].empty?
33
+ cmd << '--debug' if options[:debug]
34
+
35
+ status = execute make(cmd)
36
+ status
37
+ end
38
+
39
+ def make(cmd_parts)
40
+ cmd_parts.join ' '
41
+ end
42
+
43
+ def execute(cmd)
44
+ system cmd
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,69 @@
1
+ require 'spec_helper'
2
+
3
+ describe Guard::Codeception do
4
+
5
+ describe '#initialize' do
6
+
7
+ context 'when no options are provided' do
8
+
9
+ it 'has :test_on_start set to false' do
10
+ subject.options[:test_on_start].should == false
11
+ end
12
+
13
+ it 'has :suites set to [:acceptance, :functional, :unit]' do
14
+ subject.options[:suites].should == [:acceptance, :functional, :unit]
15
+ end
16
+
17
+ it 'has :debug set to false' do
18
+ subject.options[:debug].should == false
19
+ end
20
+
21
+ it 'has :groups set to []' do
22
+ subject.options[:groups].should == []
23
+ end
24
+ end
25
+
26
+ context 'when options are provided' do
27
+
28
+ subject do
29
+ Guard::Codeception.new test_on_start: true, suites: [], debug: true, groups: [:foo]
30
+ end
31
+
32
+ it 'has :test_on_start set to true' do
33
+ subject.options[:test_on_start].should == true
34
+ end
35
+
36
+ it 'has suites set to []' do
37
+ subject.options[:suites].should == []
38
+ end
39
+
40
+ it 'has debug set to true' do
41
+ subject.options[:debug].should == true
42
+ end
43
+
44
+ it 'has suites set to [:foo]' do
45
+ subject.options[:groups].should == [:foo]
46
+ end
47
+ end
48
+ end
49
+
50
+ describe '#start' do
51
+
52
+ it 'should\'t call #run_all' do
53
+ subject.should_not_receive(:run_all)
54
+ subject.start
55
+ end
56
+
57
+ context 'with :run_on_start set to true' do
58
+
59
+ subject do
60
+ Guard::Codeception.new test_on_start: true
61
+ end
62
+
63
+ it 'should call #run_all' do
64
+ subject.should_receive(:run)
65
+ subject.start
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,9 @@
1
+ require 'rspec'
2
+ require 'guard/codeception'
3
+
4
+ RSpec.configure do |config|
5
+ config.treat_symbols_as_metadata_keys_with_true_values = true
6
+ config.run_all_when_everything_filtered = true
7
+ config.filter_run :focus
8
+ config.order = 'random'
9
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-codeception
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Colby Swandale
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.14'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '2.14'
69
+ description: Guard gem for codeception
70
+ email:
71
+ - colby@taplaboratories.com.au
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .rspec
78
+ - .travis.yml
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - guard-codeception.gemspec
84
+ - lib/guard/codeception.rb
85
+ - lib/guard/codeception/templates/Guardfile
86
+ - lib/guard/codeception/version.rb
87
+ - spec/guard/codeception_spec.rb
88
+ - spec/spec_helper.rb
89
+ homepage: http://www.taplaboratories.com.au/guard-codeception
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.1.11
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: guard-codeception automatically runs codeception on file changes
113
+ test_files:
114
+ - spec/guard/codeception_spec.rb
115
+ - spec/spec_helper.rb