jasmine 1.3.1 → 1.3.2
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.
- data/README.markdown +0 -2
- data/generators/jasmine/jasmine_generator.rb +1 -0
- data/generators/jasmine/templates/spec/javascripts/support/jasmine.yml +14 -0
- data/generators/jasmine/templates/spec/javascripts/support/jasmine_helper.rb +11 -0
- data/jasmine.gemspec +2 -0
- data/lib/generators/jasmine/install/USAGE +0 -2
- data/lib/generators/jasmine/install/templates/spec/javascripts/support/jasmine_helper.rb +11 -0
- data/lib/jasmine/asset_expander.rb +2 -3
- data/lib/jasmine/command_line_tool.rb +11 -16
- data/lib/jasmine/config.rb +2 -1
- data/lib/jasmine/selenium_driver.rb +1 -0
- data/lib/jasmine/version.rb +1 -1
- data/lib/jasmine/yaml_config_parser.rb +4 -0
- data/{RELEASE_NOTES.markdown → release_notes/v1.2.1.md} +1 -1
- data/release_notes/v1.3.2.md +32 -0
- data/spec/asset_expander_spec.rb +1 -2
- data/spec/yaml_config_parser_spec.rb +20 -0
- metadata +25 -6
data/README.markdown
CHANGED
@@ -53,8 +53,6 @@ This uses Selenium to launch a browser and run the Jasmine suite. Then it uses R
|
|
53
53
|
Customize `spec/javascripts/support/jasmine.yml` to enumerate the source files, stylesheets, and spec files you would like the Jasmine runner to include.
|
54
54
|
You may use dir glob strings.
|
55
55
|
|
56
|
-
For more complex configuration (e.g., port number), edit `spec/javascripts/support/jasmine_config.rb` file directly.
|
57
|
-
|
58
56
|
## Note about the CI task and RSpec
|
59
57
|
|
60
58
|
This gem requires RSpec for the `jasmine:ci` rake task to work. But this gem does not explicitly *depend* on any version of the RSpec gem.
|
@@ -14,6 +14,7 @@ class JasmineGenerator < Rails::Generator::Base
|
|
14
14
|
|
15
15
|
m.directory "spec/javascripts/support"
|
16
16
|
m.file "spec/javascripts/support/jasmine-rails.yml", "spec/javascripts/support/jasmine.yml"
|
17
|
+
m.file "spec/javascripts/support/jasmine_helper.rb", "spec/javascripts/support/jasmine_helper.rb"
|
17
18
|
m.readme "INSTALL"
|
18
19
|
|
19
20
|
m.directory "lib/tasks"
|
@@ -72,3 +72,17 @@ src_dir:
|
|
72
72
|
# spec_dir: spec/javascripts
|
73
73
|
#
|
74
74
|
spec_dir:
|
75
|
+
|
76
|
+
# spec_helper
|
77
|
+
#
|
78
|
+
# Ruby file that Jasmine server will require before starting.
|
79
|
+
# Returned relative to your root path
|
80
|
+
# Default spec/support/jasmine_helper.rb
|
81
|
+
#
|
82
|
+
# EXAMPLE:
|
83
|
+
#
|
84
|
+
# spec_helper: spec/support/jasmine_helper.rb
|
85
|
+
#
|
86
|
+
spec_helper: spec/support/jasmine_helper.rb
|
87
|
+
|
88
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#Use this file to set/override Jasmine configuration options
|
2
|
+
#You can remove it if you don't need it.
|
3
|
+
#This file is loaded *after* jasmine.yml is interpreted.
|
4
|
+
#
|
5
|
+
#Example: using a different boot file.
|
6
|
+
#Jasmine.configure do |config|
|
7
|
+
# config.boot_dir = '/absolute/path/to/boot_dir'
|
8
|
+
# config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] }
|
9
|
+
#end
|
10
|
+
#
|
11
|
+
|
data/jasmine.gemspec
CHANGED
@@ -67,6 +67,8 @@ Gem::Specification.new do |s|
|
|
67
67
|
s.add_development_dependency 'json_pure'
|
68
68
|
s.add_development_dependency 'nokogiri'
|
69
69
|
|
70
|
+
s.add_development_dependency 'anchorman'
|
71
|
+
|
70
72
|
s.add_dependency 'jasmine-core', "~> 1.3.1"
|
71
73
|
s.add_dependency 'rack', '~> 1.0'
|
72
74
|
s.add_dependency 'rspec', '>= 1.3.1'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#Use this file to set/override Jasmine configuration options
|
2
|
+
#You can remove it if you don't need it.
|
3
|
+
#This file is loaded *after* jasmine.yml is interpreted.
|
4
|
+
#
|
5
|
+
#Example: using a different boot file.
|
6
|
+
#Jasmine.configure do |config|
|
7
|
+
# @config.boot_dir = '/absolute/path/to/boot_dir'
|
8
|
+
# @config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] }
|
9
|
+
#end
|
10
|
+
#
|
11
|
+
|
@@ -10,9 +10,8 @@ module Jasmine
|
|
10
10
|
bundled_asset = @bundled_asset_factory.call(pathname, 'js')
|
11
11
|
return nil unless bundled_asset
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
assets << "/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true"
|
13
|
+
bundled_asset.to_a.map do |asset|
|
14
|
+
"/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true"
|
16
15
|
end.flatten
|
17
16
|
end
|
18
17
|
end
|
@@ -36,23 +36,18 @@ module Jasmine
|
|
36
36
|
copy_unless_exists('jasmine-example/spec/PlayerSpec.js', 'spec/javascripts/PlayerSpec.js')
|
37
37
|
copy_unless_exists('jasmine-example/spec/SpecHelper.js', 'spec/javascripts/helpers/SpecHelper.js')
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
if File.exist?(dest_path('Rakefile'))
|
48
|
-
load dest_path('Rakefile')
|
49
|
-
write_mode = 'a'
|
50
|
-
end
|
39
|
+
copy_unless_exists('spec/javascripts/support/jasmine.yml')
|
40
|
+
copy_unless_exists('spec/javascripts/support/jasmine_helper.rb')
|
41
|
+
require 'rake'
|
42
|
+
write_mode = 'w'
|
43
|
+
if File.exist?(dest_path('Rakefile'))
|
44
|
+
load dest_path('Rakefile')
|
45
|
+
write_mode = 'a'
|
46
|
+
end
|
51
47
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
48
|
+
unless Rake::Task.task_defined?('jasmine')
|
49
|
+
File.open(dest_path('Rakefile'), write_mode) do |f|
|
50
|
+
f.write("\n" + File.read(template_path('lib/tasks/jasmine.rake')))
|
56
51
|
end
|
57
52
|
end
|
58
53
|
File.open(template_path('INSTALL'), 'r').each_line do |line|
|
data/lib/jasmine/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
module Jasmine
|
2
|
+
require 'yaml'
|
2
3
|
require 'erb'
|
3
4
|
def self.configure(&block)
|
4
5
|
block.call(self.config)
|
@@ -21,7 +22,6 @@ module Jasmine
|
|
21
22
|
@config.boot_files = lambda { core_config.boot_files }
|
22
23
|
@config.jasmine_files = lambda { core_config.js_files }
|
23
24
|
@config.jasmine_css_files = lambda { core_config.css_files }
|
24
|
-
|
25
25
|
@config.add_rack_path(jasmine_path, lambda { Rack::File.new(config.jasmine_dir) })
|
26
26
|
@config.add_rack_path(boot_path, lambda { Rack::File.new(config.boot_dir) })
|
27
27
|
@config.add_rack_path(spec_path, lambda { Rack::File.new(config.spec_dir) })
|
@@ -79,6 +79,7 @@ module Jasmine
|
|
79
79
|
config.src_dir = yaml_config.src_dir
|
80
80
|
config.spec_dir = yaml_config.spec_dir
|
81
81
|
end
|
82
|
+
require yaml_config.spec_helper if File.exist?(yaml_config.spec_helper)
|
82
83
|
end
|
83
84
|
end
|
84
85
|
|
data/lib/jasmine/version.rb
CHANGED
@@ -46,6 +46,10 @@ module Jasmine
|
|
46
46
|
@path_expander.call(src_dir, loaded_yaml['stylesheets'] || [])
|
47
47
|
end
|
48
48
|
|
49
|
+
def spec_helper
|
50
|
+
File.join(@pwd, loaded_yaml['spec_helper'] || File.join('spec', 'javascripts', 'support', 'jasmine_helper.rb'))
|
51
|
+
end
|
52
|
+
|
49
53
|
private
|
50
54
|
def loaded_yaml
|
51
55
|
@yaml_loader.call(@path)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Jasmine Gem v1.3.2
|
2
|
+
|
3
|
+
## Summary
|
4
|
+
|
5
|
+
This release removes some pre-1.3 cruft in documentation regarding the old configuration files. Also fixes the JSON/YAML require bug.
|
6
|
+
|
7
|
+
Best approach is to delete your Jasmine support files and clean out jasmine from your Rakefile and call `jasmine init` again.
|
8
|
+
|
9
|
+
## Changes
|
10
|
+
|
11
|
+
* Removed incorrect asset_path mapping
|
12
|
+
* Including `asset_file` (the manifest) fails if asset file is itself templated (erb, coffee), or if asset file uses `require_self`.
|
13
|
+
* Use `require_self` if it is necessary to include javascript inside of a Sprockets manifest file (like `application.js`)
|
14
|
+
* SHA: [be9851192e78ffe635087e5583b15ebe683dc0d9](http://github.com/pivotal/jasmine-gem/commit/be9851192e78ffe635087e5583b15ebe683dc0d9)
|
15
|
+
* Load `jasmine_helper` after configuring from yaml
|
16
|
+
* Allows users opportunity to add a `Jasmine.configure` block that overrides/augments `jasmine.yml` settings
|
17
|
+
* File defaults to `specs/javascript/support/jasmine_helper.rb` but is configurable from `jasmine.yml`
|
18
|
+
* *Only* processed if using `jasmine.yml` (which default rake tasks will do if `jasmine.yml` exists).
|
19
|
+
* SHA: [63e8d46556a421cbb3b511b52cd8c2188d72b9db](http://github.com/pivotal/jasmine-gem/commit/63e8d46556a421cbb3b511b52cd8c2188d72b9db)
|
20
|
+
* Rails generators should be used for Rails installs
|
21
|
+
* SHA: [5d1d500fdc2462951de901513f2aacc5286f20c1](http://github.com/pivotal/jasmine-gem/commit/5d1d500fdc2462951de901513f2aacc5286f20c1)
|
22
|
+
* Fix reference error of YAML and JSON
|
23
|
+
* Merge pull request #119 from kozy4324
|
24
|
+
* SHA: [442135f648970fcaf5e4163a672a78fbea65e118](http://github.com/pivotal/jasmine-gem/commit/442135f648970fcaf5e4163a672a78fbea65e118)
|
25
|
+
* Removed references in docs to pre-1.3 files that are no longer used
|
26
|
+
* Merged pull request #132 from levent
|
27
|
+
* Merged pull request #129 from mcolyer
|
28
|
+
* Merged pull request #130 from mcolyer
|
29
|
+
|
30
|
+
------
|
31
|
+
|
32
|
+
_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
|
data/spec/asset_expander_spec.rb
CHANGED
@@ -22,8 +22,7 @@ describe Jasmine::AssetExpander do
|
|
22
22
|
|
23
23
|
expander = Jasmine::AssetExpander.new(bundled_asset_getter, asset_path_getter)
|
24
24
|
expanded_assets = expander.expand('/some_src_dir', 'asset_file')
|
25
|
-
expanded_assets.should == ['/
|
26
|
-
'/asset1_path?body=true',
|
25
|
+
expanded_assets.should == ['/asset1_path?body=true',
|
27
26
|
'/asset2_path?body=true']
|
28
27
|
end
|
29
28
|
|
@@ -41,6 +41,26 @@ describe Jasmine::YamlConfigParser do
|
|
41
41
|
parser.jasmine_dir.should == File.join('some_project_root', 'some_jasmine_dir')
|
42
42
|
end
|
43
43
|
|
44
|
+
it "spec_helper returns default helper path when spec_helper is blank" do
|
45
|
+
yaml_loader = lambda do |path|
|
46
|
+
if path == "some_path"
|
47
|
+
{"spec_helper" => nil}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
parser = Jasmine::YamlConfigParser.new('some_path', 'some_project_root', nil, yaml_loader)
|
51
|
+
parser.spec_helper.should == 'some_project_root/spec/javascripts/support/jasmine_helper.rb'
|
52
|
+
end
|
53
|
+
|
54
|
+
it "spec_helper returns spec_helper if set" do
|
55
|
+
yaml_loader = lambda do |path|
|
56
|
+
if path == "some_path"
|
57
|
+
{"spec_helper" => 'some_spec_helper.rb'}
|
58
|
+
end
|
59
|
+
end
|
60
|
+
parser = Jasmine::YamlConfigParser.new('some_path', 'some_project_root', nil, yaml_loader)
|
61
|
+
parser.spec_helper.should == 'some_project_root/some_spec_helper.rb'
|
62
|
+
end
|
63
|
+
|
44
64
|
it "spec_dir uses default path when spec dir is blank" do
|
45
65
|
yaml_loader = lambda do |path|
|
46
66
|
if path == "some_path"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2013-03-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -109,6 +109,22 @@ dependencies:
|
|
109
109
|
- - ! '>='
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: anchorman
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
112
128
|
- !ruby/object:Gem::Dependency
|
113
129
|
name: jasmine-core
|
114
130
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,7 +205,6 @@ files:
|
|
189
205
|
- MIT.LICENSE
|
190
206
|
- README.markdown
|
191
207
|
- RELEASE.markdown
|
192
|
-
- RELEASE_NOTES.markdown
|
193
208
|
- Rakefile
|
194
209
|
- bin/jasmine
|
195
210
|
- generators/jasmine/jasmine_generator.rb
|
@@ -202,6 +217,7 @@ files:
|
|
202
217
|
- generators/jasmine/templates/lib/tasks/jasmine.rake
|
203
218
|
- generators/jasmine/templates/spec/javascripts/support/jasmine-rails.yml
|
204
219
|
- generators/jasmine/templates/spec/javascripts/support/jasmine.yml
|
220
|
+
- generators/jasmine/templates/spec/javascripts/support/jasmine_helper.rb
|
205
221
|
- jasmine.gemspec
|
206
222
|
- lib/generators/jasmine/examples/USAGE
|
207
223
|
- lib/generators/jasmine/examples/examples_generator.rb
|
@@ -213,6 +229,7 @@ files:
|
|
213
229
|
- lib/generators/jasmine/install/install_generator.rb
|
214
230
|
- lib/generators/jasmine/install/templates/spec/javascripts/helpers/.gitkeep
|
215
231
|
- lib/generators/jasmine/install/templates/spec/javascripts/support/jasmine.yml
|
232
|
+
- lib/generators/jasmine/install/templates/spec/javascripts/support/jasmine_helper.rb
|
216
233
|
- lib/jasmine.rb
|
217
234
|
- lib/jasmine/application.rb
|
218
235
|
- lib/jasmine/asset_expander.rb
|
@@ -248,6 +265,8 @@ files:
|
|
248
265
|
- lib/rack/jasmine/cache_control.rb
|
249
266
|
- lib/rack/jasmine/focused_suite.rb
|
250
267
|
- lib/rack/jasmine/runner.rb
|
268
|
+
- release_notes/v1.2.1.md
|
269
|
+
- release_notes/v1.3.2.md
|
251
270
|
- spec/application_integration_spec.rb
|
252
271
|
- spec/application_spec.rb
|
253
272
|
- spec/asset_expander_spec.rb
|
@@ -288,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
288
307
|
version: '0'
|
289
308
|
segments:
|
290
309
|
- 0
|
291
|
-
hash: -
|
310
|
+
hash: -4429629343753385454
|
292
311
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
293
312
|
none: false
|
294
313
|
requirements:
|
@@ -297,10 +316,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
297
316
|
version: '0'
|
298
317
|
segments:
|
299
318
|
- 0
|
300
|
-
hash: -
|
319
|
+
hash: -4429629343753385454
|
301
320
|
requirements: []
|
302
321
|
rubyforge_project:
|
303
|
-
rubygems_version: 1.8.
|
322
|
+
rubygems_version: 1.8.25
|
304
323
|
signing_key:
|
305
324
|
specification_version: 3
|
306
325
|
summary: JavaScript BDD framework
|