guard-jasmine 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +42 -14
- data/lib/guard/jasmine.rb +1 -1
- data/lib/guard/jasmine/cli.rb +1 -1
- data/lib/guard/jasmine/task.rb +42 -0
- data/lib/guard/jasmine/version.rb +1 -1
- metadata +99 -150
data/README.md
CHANGED
@@ -18,7 +18,7 @@ various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
|
|
18
18
|
* Runs the standard Jasmine test runner, so you can use [Jasminerice][] for integrating [Jasmine][] into the
|
19
19
|
[Rails 3.1 asset pipeline][] and write your specs in [CoffeeScript][].
|
20
20
|
|
21
|
-
*
|
21
|
+
* Thor and Rake command line helper for CI server integration.
|
22
22
|
|
23
23
|
* Runs on Mac OS X, Linux and Windows.
|
24
24
|
|
@@ -332,7 +332,9 @@ So if you want to have a precise spec detection, you should:
|
|
332
332
|
To get a feeling how your naming strategy works, play with the web based Jasmine runner and modify the `spec` query
|
333
333
|
parameter.
|
334
334
|
|
335
|
-
## Guard::Jasmine
|
335
|
+
## Guard::Jasmine outside of Guard
|
336
|
+
|
337
|
+
### Thor command line utility
|
336
338
|
|
337
339
|
Guard::Jasmine includes a little command line utility to run your specs once and output the specdoc to the console.
|
338
340
|
|
@@ -343,22 +345,26 @@ $ guard-jasmine
|
|
343
345
|
You can get help on the available options with the `help` task:
|
344
346
|
|
345
347
|
```bash
|
348
|
+
$ guard-jasmine help spec
|
349
|
+
|
346
350
|
Usage:
|
347
351
|
guard-jasmine spec
|
348
352
|
|
349
353
|
Options:
|
350
|
-
-s, [--server=SERVER]
|
351
|
-
|
352
|
-
-p, [--port=N]
|
353
|
-
|
354
|
-
-u, [--url=URL]
|
355
|
-
|
356
|
-
-b, [--bin=BIN]
|
357
|
-
|
358
|
-
-t, [--timeout=N]
|
359
|
-
|
360
|
-
-c, [--console=CONSOLE]
|
361
|
-
|
354
|
+
-s, [--server=SERVER] # Server to start, either `auto`, `none`, `webrick`, `mongrel`, `thin`, `jasmine_gem`
|
355
|
+
# Default: auto
|
356
|
+
-p, [--port=N] # Server port to use
|
357
|
+
# Default: 8888
|
358
|
+
-u, [--url=URL] # The url of the Jasmine test runner
|
359
|
+
# Default: http://127.0.0.1:8888/jasmine
|
360
|
+
-b, [--bin=BIN] # The location of the PhantomJS binary
|
361
|
+
# Default: /usr/local/bin/phantomjs
|
362
|
+
-t, [--timeout=N] # The maximum time in milliseconds to wait for the spec runner to finish
|
363
|
+
# Default: 10000
|
364
|
+
-c, [--console=CONSOLE] # Whether to show console.log statements in the spec runner, either `always`, `never` or `failure`
|
365
|
+
# Default: failure
|
366
|
+
-e, [--server-env=SERVER_ENV] # The server environment to use, for example `development`, `test` etc.
|
367
|
+
# Default: test
|
362
368
|
|
363
369
|
Run the Jasmine spec runner
|
364
370
|
```
|
@@ -369,6 +375,28 @@ By default all specs are run, but you can supply multiple paths to your specs to
|
|
369
375
|
$ guard-jasmine spec/javascripts/a_spec.js.coffee spec/javascripts/another_spec.js.coffee
|
370
376
|
```
|
371
377
|
|
378
|
+
### Rake task integration
|
379
|
+
|
380
|
+
Guard::Jasmine provides a Rake task wrapper around the Thor command line utility. Simply create a JasmineTask within
|
381
|
+
your `Rakefile`:
|
382
|
+
|
383
|
+
```ruby
|
384
|
+
require 'guard/jasmine/task'
|
385
|
+
Guard::JasmineTask.new
|
386
|
+
```
|
387
|
+
|
388
|
+
You can configure the CLI options either by providing the options as parameter or use a block:
|
389
|
+
|
390
|
+
```ruby
|
391
|
+
require 'guard/jasmine/task'
|
392
|
+
|
393
|
+
Guard::JasmineTask.new do |task|
|
394
|
+
task.options = '-t 15 -e test'
|
395
|
+
end
|
396
|
+
|
397
|
+
Guard::JasmineTask.new(:jasmine_no_server, '-s none')
|
398
|
+
```
|
399
|
+
|
372
400
|
### Travis CI integration
|
373
401
|
|
374
402
|
With the given `guard-jasmine` script you're able to configure [Travis CI](http://travis-ci.org/) to run Guard::Jasmine.
|
data/lib/guard/jasmine.rb
CHANGED
data/lib/guard/jasmine/cli.rb
CHANGED
@@ -59,7 +59,7 @@ module Guard
|
|
59
59
|
method_option :server_env,
|
60
60
|
:type => :string,
|
61
61
|
:aliases => '-e',
|
62
|
-
:default => '
|
62
|
+
:default => 'test',
|
63
63
|
:desc => 'The server environment to use, for example `development`, `test` etc.'
|
64
64
|
|
65
65
|
# Run the Guard::Jasmine::Runner with options from
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
require 'rake/tasklib'
|
5
|
+
|
6
|
+
require 'guard/jasmine/cli'
|
7
|
+
|
8
|
+
module Guard
|
9
|
+
|
10
|
+
# Provides a method to define a Rake task that
|
11
|
+
# runs the Jasmine specs.
|
12
|
+
#
|
13
|
+
class JasmineTask < ::Rake::TaskLib
|
14
|
+
|
15
|
+
# Name of the main, top level task
|
16
|
+
attr_accessor :name
|
17
|
+
|
18
|
+
# CLI options
|
19
|
+
attr_accessor :options
|
20
|
+
|
21
|
+
# Initialize the Rake task
|
22
|
+
#
|
23
|
+
# @param [Symbol] name the name of the Rake task
|
24
|
+
# @param [String] options the CLI options
|
25
|
+
# @yield [JasmineTask] the task
|
26
|
+
#
|
27
|
+
def initialize(name = :jasmine, options = '')
|
28
|
+
@name = name
|
29
|
+
@options = options
|
30
|
+
|
31
|
+
yield self if block_given?
|
32
|
+
|
33
|
+
namespace :guard do
|
34
|
+
desc 'Run all Jasmine specs'
|
35
|
+
task(name) do
|
36
|
+
Guard::Jasmine::CLI.start(options.split)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,175 +1,135 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-jasmine
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.7
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 9
|
9
|
-
- 6
|
10
|
-
version: 0.9.6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Michael Kessler
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: guard
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70259392172400 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 57
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 8
|
32
|
-
- 3
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.8.3
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: multi_json
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: *70259392172400
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: multi_json
|
27
|
+
requirement: &70259392172020 !ruby/object:Gem::Requirement
|
40
28
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
48
33
|
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: childprocess
|
52
34
|
prerelease: false
|
53
|
-
|
35
|
+
version_requirements: *70259392172020
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: childprocess
|
38
|
+
requirement: &70259392171380 !ruby/object:Gem::Requirement
|
54
39
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
62
44
|
type: :runtime
|
63
|
-
version_requirements: *id003
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
name: thor
|
66
45
|
prerelease: false
|
67
|
-
|
46
|
+
version_requirements: *70259392171380
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: thor
|
49
|
+
requirement: &70259392170760 !ruby/object:Gem::Requirement
|
68
50
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
segments:
|
74
|
-
- 0
|
75
|
-
version: "0"
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
76
55
|
type: :runtime
|
77
|
-
version_requirements: *id004
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: bundler
|
80
56
|
prerelease: false
|
81
|
-
|
57
|
+
version_requirements: *70259392170760
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: bundler
|
60
|
+
requirement: &70259392170080 !ruby/object:Gem::Requirement
|
82
61
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
segments:
|
88
|
-
- 0
|
89
|
-
version: "0"
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
90
66
|
type: :development
|
91
|
-
version_requirements: *id005
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
|
-
name: guard-rspec
|
94
67
|
prerelease: false
|
95
|
-
|
68
|
+
version_requirements: *70259392170080
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard-rspec
|
71
|
+
requirement: &70259392169380 !ruby/object:Gem::Requirement
|
96
72
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
segments:
|
102
|
-
- 0
|
103
|
-
version: "0"
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
104
77
|
type: :development
|
105
|
-
version_requirements: *id006
|
106
|
-
- !ruby/object:Gem::Dependency
|
107
|
-
name: rspec
|
108
78
|
prerelease: false
|
109
|
-
|
79
|
+
version_requirements: *70259392169380
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rspec
|
82
|
+
requirement: &70259392168840 !ruby/object:Gem::Requirement
|
110
83
|
none: false
|
111
|
-
requirements:
|
112
|
-
- -
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
|
115
|
-
segments:
|
116
|
-
- 0
|
117
|
-
version: "0"
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
118
88
|
type: :development
|
119
|
-
version_requirements: *id007
|
120
|
-
- !ruby/object:Gem::Dependency
|
121
|
-
name: yard
|
122
89
|
prerelease: false
|
123
|
-
|
90
|
+
version_requirements: *70259392168840
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: yard
|
93
|
+
requirement: &70259392163580 !ruby/object:Gem::Requirement
|
124
94
|
none: false
|
125
|
-
requirements:
|
126
|
-
- -
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
|
129
|
-
segments:
|
130
|
-
- 0
|
131
|
-
version: "0"
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
132
99
|
type: :development
|
133
|
-
version_requirements: *id008
|
134
|
-
- !ruby/object:Gem::Dependency
|
135
|
-
name: redcarpet
|
136
100
|
prerelease: false
|
137
|
-
|
101
|
+
version_requirements: *70259392163580
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: redcarpet
|
104
|
+
requirement: &70259392162940 !ruby/object:Gem::Requirement
|
138
105
|
none: false
|
139
|
-
requirements:
|
140
|
-
- -
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
|
143
|
-
segments:
|
144
|
-
- 0
|
145
|
-
version: "0"
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
146
110
|
type: :development
|
147
|
-
version_requirements: *id009
|
148
|
-
- !ruby/object:Gem::Dependency
|
149
|
-
name: pry
|
150
111
|
prerelease: false
|
151
|
-
|
112
|
+
version_requirements: *70259392162940
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: pry
|
115
|
+
requirement: &70259392161960 !ruby/object:Gem::Requirement
|
152
116
|
none: false
|
153
|
-
requirements:
|
154
|
-
- -
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
|
157
|
-
segments:
|
158
|
-
- 0
|
159
|
-
version: "0"
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
160
121
|
type: :development
|
161
|
-
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: *70259392161960
|
162
124
|
description: Guard::Jasmine automatically tests your Jasmine specs on PhantomJS
|
163
|
-
email:
|
125
|
+
email:
|
164
126
|
- michi@netzpiraten.ch
|
165
|
-
executables:
|
127
|
+
executables:
|
166
128
|
- guard-jasmine
|
167
129
|
- guard-jasmine-debug
|
168
130
|
extensions: []
|
169
|
-
|
170
131
|
extra_rdoc_files: []
|
171
|
-
|
172
|
-
files:
|
132
|
+
files:
|
173
133
|
- bin/guard-jasmine
|
174
134
|
- bin/guard-jasmine-debug
|
175
135
|
- lib/guard/jasmine/cli.rb
|
@@ -183,6 +143,7 @@ files:
|
|
183
143
|
- lib/guard/jasmine/runner.rbc
|
184
144
|
- lib/guard/jasmine/server.rb
|
185
145
|
- lib/guard/jasmine/server.rbc
|
146
|
+
- lib/guard/jasmine/task.rb
|
186
147
|
- lib/guard/jasmine/templates/Guardfile
|
187
148
|
- lib/guard/jasmine/version.rb
|
188
149
|
- lib/guard/jasmine/version.rbc
|
@@ -192,39 +153,27 @@ files:
|
|
192
153
|
- README.md
|
193
154
|
homepage: https://github.com/netzpirat/guard-jasmine
|
194
155
|
licenses: []
|
195
|
-
|
196
156
|
post_install_message:
|
197
157
|
rdoc_options: []
|
198
|
-
|
199
|
-
require_paths:
|
158
|
+
require_paths:
|
200
159
|
- lib
|
201
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
202
161
|
none: false
|
203
|
-
requirements:
|
204
|
-
- -
|
205
|
-
- !ruby/object:Gem::Version
|
206
|
-
|
207
|
-
|
208
|
-
- 0
|
209
|
-
version: "0"
|
210
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
167
|
none: false
|
212
|
-
requirements:
|
213
|
-
- -
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
hash: 23
|
216
|
-
segments:
|
217
|
-
- 1
|
218
|
-
- 3
|
219
|
-
- 6
|
168
|
+
requirements:
|
169
|
+
- - ! '>='
|
170
|
+
- !ruby/object:Gem::Version
|
220
171
|
version: 1.3.6
|
221
172
|
requirements: []
|
222
|
-
|
223
173
|
rubyforge_project: guard-jasmine
|
224
174
|
rubygems_version: 1.8.10
|
225
175
|
signing_key:
|
226
176
|
specification_version: 3
|
227
177
|
summary: Guard gem for headless testing with Jasmine
|
228
178
|
test_files: []
|
229
|
-
|
230
179
|
has_rdoc:
|