jasmine-rails 0.5.2 → 0.5.3
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.md +3 -3
- data/lib/jasmine_rails/offline_asset_paths.rb +3 -2
- data/lib/jasmine_rails/runner.rb +2 -1
- data/lib/jasmine_rails/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -45,7 +45,7 @@ writing specs!
|
|
45
45
|
|
46
46
|
## Configuration
|
47
47
|
|
48
|
-
Configuring the Jasmine test runner is done in `spec/javascripts/support/jasmine.yml`.
|
48
|
+
Configuring the Jasmine test runner is done in `spec/javascripts/support/jasmine.yml`.
|
49
49
|
|
50
50
|
## Asset Pipeline Support
|
51
51
|
|
@@ -72,8 +72,8 @@ spec_files:
|
|
72
72
|
You can write a spec to test Foo in `spec/javascripts/foo_spec.js`:
|
73
73
|
|
74
74
|
```javascript
|
75
|
-
// include spec/javascripts/helpers/
|
76
|
-
//= require helpers/
|
75
|
+
// include spec/javascripts/helpers/some_helper_file.js and app/assets/javascripts/foo.js
|
76
|
+
//= require helpers/some_helper_file
|
77
77
|
//= require foo
|
78
78
|
describe('Foo', function() {
|
79
79
|
it("does something", function() {
|
@@ -21,7 +21,8 @@ module JasmineRails
|
|
21
21
|
source = source.to_s
|
22
22
|
return source if source.starts_with?('/')
|
23
23
|
content = Rails.application.assets[source].to_s
|
24
|
-
|
24
|
+
asset_prefix = Rails.configuration.assets.prefix.gsub(/\A\//,'')
|
25
|
+
source_path = JasmineRails.tmp_dir.join(asset_prefix).join(source)
|
25
26
|
|
26
27
|
FileUtils.mkdir_p File.dirname(source_path)
|
27
28
|
Rails.logger.debug "Compiling #{source} to #{source_path}"
|
@@ -32,7 +33,7 @@ module JasmineRails
|
|
32
33
|
f << content
|
33
34
|
end
|
34
35
|
end
|
35
|
-
"
|
36
|
+
"/#{asset_prefix}/#{source}"
|
36
37
|
end
|
37
38
|
|
38
39
|
end
|
data/lib/jasmine_rails/runner.rb
CHANGED
@@ -10,7 +10,8 @@ module JasmineRails
|
|
10
10
|
include_offline_asset_paths_helper
|
11
11
|
html = get_spec_runner(spec_filter)
|
12
12
|
runner_path = JasmineRails.tmp_dir.join('runner.html')
|
13
|
-
|
13
|
+
asset_prefix = Rails.configuration.assets.prefix.gsub(/\A\//,'')
|
14
|
+
File.open(runner_path, 'w') {|f| f << html.gsub("/#{asset_prefix}", "./#{asset_prefix}")}
|
14
15
|
|
15
16
|
phantomjs_runner_path = File.join(File.dirname(__FILE__), '..', 'assets', 'javascripts', 'jasmine-runner.js')
|
16
17
|
run_cmd %{phantomjs "#{phantomjs_runner_path}" "#{runner_path.to_s}?spec=#{spec_filter}"}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
segments:
|
128
128
|
- 0
|
129
|
-
hash:
|
129
|
+
hash: 2322879395894389428
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
none: false
|
132
132
|
requirements:
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
segments:
|
137
137
|
- 0
|
138
|
-
hash:
|
138
|
+
hash: 2322879395894389428
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
141
|
rubygems_version: 1.8.23
|