jasmine-headless-webkit 0.7.3.2 → 0.8.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +6 -0
  3. data/Rakefile +19 -0
  4. data/bin/jasmine-headless-webkit +2 -22
  5. data/jasmine-headless-webkit.gemspec +5 -4
  6. data/lib/digest/jasmine_test.rb +20 -0
  7. data/lib/jasmine/headless/cacheable_action.rb +1 -3
  8. data/lib/jasmine/headless/coffee_template.rb +30 -0
  9. data/lib/jasmine/headless/command_line.rb +31 -0
  10. data/lib/jasmine/headless/css_template.rb +14 -0
  11. data/lib/jasmine/headless/files_list.rb +251 -0
  12. data/lib/jasmine/headless/js_template.rb +18 -0
  13. data/lib/jasmine/headless/jst_template.rb +10 -0
  14. data/lib/jasmine/headless/options.rb +6 -1
  15. data/lib/jasmine/headless/runner.rb +14 -5
  16. data/lib/jasmine/headless/task.rb +2 -21
  17. data/lib/jasmine/headless/unique_asset_list.rb +14 -0
  18. data/lib/jasmine/headless/version.rb +1 -1
  19. data/lib/jasmine/headless.rb +11 -0
  20. data/lib/jasmine-headless-webkit.rb +4 -4
  21. data/skel/template.html.erb +13 -3
  22. data/spec/integration/randomization_spec.rb +13 -0
  23. data/spec/integration/specify_runner_file_spec.rb +22 -0
  24. data/spec/integration/sprockets_spec.rb +19 -0
  25. data/spec/jasmine/console_log/console_log.yml +1 -1
  26. data/spec/jasmine/runner_out_in_jasmine_yml/jasmine.yml +11 -0
  27. data/spec/jasmine/runner_out_in_jasmine_yml/test.js +2 -0
  28. data/spec/jasmine/runner_out_in_jasmine_yml/test_spec.coffee +4 -0
  29. data/spec/jasmine/with_sprockets_includes/assets/application.js.erb +2 -0
  30. data/spec/jasmine/with_sprockets_includes/assets/things/code.js +6 -0
  31. data/spec/jasmine/with_sprockets_includes/assets/things/required.js +2 -0
  32. data/spec/jasmine/with_sprockets_includes/assets/things/subcode/more_code.js +2 -0
  33. data/spec/jasmine/with_sprockets_includes/assets/things/templates/that.jst.ejs +1 -0
  34. data/spec/jasmine/with_sprockets_includes/assets/things/templates/this.jst +2 -0
  35. data/spec/jasmine/with_sprockets_includes/spec/spec_helper.js +1 -0
  36. data/spec/jasmine/with_sprockets_includes/spec/things/code_spec.js +9 -0
  37. data/spec/jasmine/with_sprockets_includes/with_sprockets_includes.yml +12 -0
  38. data/spec/javascripts/console.log_spec.coffee +15 -0
  39. data/spec/javascripts/support/jasmine.yml +4 -1
  40. data/spec/lib/jasmine/headless/cacheable_action_spec.rb +6 -3
  41. data/spec/lib/jasmine/headless/coffee_template_spec.rb +55 -0
  42. data/spec/lib/jasmine/headless/css_template_spec.rb +25 -0
  43. data/spec/lib/jasmine/headless/files_list_spec.rb +203 -0
  44. data/spec/lib/jasmine/headless/js_template_spec.rb +31 -0
  45. data/spec/lib/jasmine/headless/jst_template_spec.rb +21 -0
  46. data/spec/lib/jasmine/headless/options_spec.rb +18 -0
  47. data/spec/lib/jasmine/headless/template_writer_spec.rb +8 -4
  48. data/spec/lib/jasmine/headless/unique_asset_list_spec.rb +22 -0
  49. data/spec/lib/jasmine/headless_spec.rb +2 -0
  50. data/spec/spec_helper.rb +59 -0
  51. data/vendor/assets/coffeescripts/headless_reporter_result.coffee +10 -7
  52. data/vendor/assets/coffeescripts/intense.coffee +1 -0
  53. data/vendor/assets/coffeescripts/jasmine-extensions.coffee +13 -0
  54. data/vendor/assets/coffeescripts/jasmine.HeadlessConsoleReporter.coffee +34 -2
  55. data/vendor/assets/coffeescripts/prolog.coffee +1 -1
  56. data/vendor/assets/javascripts/headless_reporter_result.js +19 -15
  57. data/vendor/assets/javascripts/intense.js +8 -1
  58. data/vendor/assets/javascripts/jasmine-extensions.js +29 -1
  59. data/vendor/assets/javascripts/jasmine.HeadlessConsoleReporter.js +53 -13
  60. data/vendor/assets/javascripts/prolog.js +6 -4
  61. metadata +83 -20
  62. data/lib/jasmine/files_list.rb +0 -176
  63. data/spec/javascripts/support/jquery-1.6.2.min.js +0 -18
  64. data/spec/lib/jasmine/files_list_spec.rb +0 -248
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine-headless-webkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3.2
5
- prerelease:
4
+ version: 0.8.0.alpha.1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - John Bintz
@@ -11,33 +11,33 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-11-21 00:00:00.000000000Z
14
+ date: 2011-11-30 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: jasmine-core
18
- requirement: &2165562680 !ruby/object:Gem::Requirement
18
+ requirement: &2156866240 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 1.1.beta
23
+ version: '1.1'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2165562680
26
+ version_requirements: *2156866240
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coffee-script
29
- requirement: &2165562180 !ruby/object:Gem::Requirement
29
+ requirement: &2156865660 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
33
33
  - !ruby/object:Gem::Version
34
- version: '2.2'
34
+ version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *2165562180
37
+ version_requirements: *2156865660
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rainbow
40
- requirement: &2165561800 !ruby/object:Gem::Requirement
40
+ requirement: &2156864940 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *2165561800
48
+ version_requirements: *2156864940
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: multi_json
51
- requirement: &2165561340 !ruby/object:Gem::Requirement
51
+ requirement: &2156863440 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,7 +56,18 @@ dependencies:
56
56
  version: '0'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *2165561340
59
+ version_requirements: *2156863440
60
+ - !ruby/object:Gem::Dependency
61
+ name: sprockets
62
+ requirement: &2156862300 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: '2'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: *2156862300
60
71
  description: Run Jasmine specs headlessly
61
72
  email:
62
73
  - john@coswellproductions.com
@@ -90,12 +101,18 @@ files:
90
101
  - lib/autotest/jasmine.rb
91
102
  - lib/autotest/jasmine_mixin.rb
92
103
  - lib/autotest/jasmine_rspec2.rb
104
+ - lib/digest/jasmine_test.rb
93
105
  - lib/jasmine-headless-webkit.rb
94
- - lib/jasmine/files_list.rb
95
106
  - lib/jasmine/headless.rb
96
107
  - lib/jasmine/headless/cacheable_action.rb
97
108
  - lib/jasmine/headless/coffee_script_cache.rb
109
+ - lib/jasmine/headless/coffee_template.rb
110
+ - lib/jasmine/headless/command_line.rb
111
+ - lib/jasmine/headless/css_template.rb
98
112
  - lib/jasmine/headless/errors.rb
113
+ - lib/jasmine/headless/files_list.rb
114
+ - lib/jasmine/headless/js_template.rb
115
+ - lib/jasmine/headless/jst_template.rb
99
116
  - lib/jasmine/headless/options.rb
100
117
  - lib/jasmine/headless/railtie.rb
101
118
  - lib/jasmine/headless/report.rb
@@ -110,6 +127,7 @@ files:
110
127
  - lib/jasmine/headless/spec_file_analyzer.rb
111
128
  - lib/jasmine/headless/task.rb
112
129
  - lib/jasmine/headless/template_writer.rb
130
+ - lib/jasmine/headless/unique_asset_list.rb
113
131
  - lib/jasmine/headless/version.rb
114
132
  - lib/qt/qmake.rb
115
133
  - script/gemfile
@@ -119,6 +137,9 @@ files:
119
137
  - skel/template.html.erb
120
138
  - spec/bin/jasmine-headless-webkit_spec.rb
121
139
  - spec/files/UTF-8-test.txt
140
+ - spec/integration/randomization_spec.rb
141
+ - spec/integration/specify_runner_file_spec.rb
142
+ - spec/integration/sprockets_spec.rb
122
143
  - spec/jasmine/click_button/click_button.js
123
144
  - spec/jasmine/click_button/click_button.yml
124
145
  - spec/jasmine/click_button/click_button_spec.js
@@ -147,19 +168,35 @@ files:
147
168
  - spec/jasmine/leave_page/leave_page.js
148
169
  - spec/jasmine/leave_page/leave_page.yml
149
170
  - spec/jasmine/leave_page/leave_page_spec.js
171
+ - spec/jasmine/runner_out_in_jasmine_yml/jasmine.yml
172
+ - spec/jasmine/runner_out_in_jasmine_yml/test.js
173
+ - spec/jasmine/runner_out_in_jasmine_yml/test_spec.coffee
150
174
  - spec/jasmine/success/success.js
151
175
  - spec/jasmine/success/success.yml
152
176
  - spec/jasmine/success/success_spec.js
153
177
  - spec/jasmine/success_with_error/success_with_error.js
154
178
  - spec/jasmine/success_with_error/success_with_error.yml
155
179
  - spec/jasmine/success_with_error/success_with_error_spec.js
180
+ - spec/jasmine/with_sprockets_includes/assets/application.js.erb
181
+ - spec/jasmine/with_sprockets_includes/assets/things/code.js
182
+ - spec/jasmine/with_sprockets_includes/assets/things/required.js
183
+ - spec/jasmine/with_sprockets_includes/assets/things/subcode/more_code.js
184
+ - spec/jasmine/with_sprockets_includes/assets/things/templates/that.jst.ejs
185
+ - spec/jasmine/with_sprockets_includes/assets/things/templates/this.jst
186
+ - spec/jasmine/with_sprockets_includes/spec/spec_helper.js
187
+ - spec/jasmine/with_sprockets_includes/spec/things/code_spec.js
188
+ - spec/jasmine/with_sprockets_includes/with_sprockets_includes.yml
189
+ - spec/javascripts/console.log_spec.coffee
156
190
  - spec/javascripts/headless_reporter_result_spec.coffee
157
191
  - spec/javascripts/jasmine.HeadlessConsoleReporter_spec.coffee
158
192
  - spec/javascripts/support/jasmine.yml
159
- - spec/javascripts/support/jquery-1.6.2.min.js
160
- - spec/lib/jasmine/files_list_spec.rb
161
193
  - spec/lib/jasmine/headless/cacheable_action_spec.rb
162
194
  - spec/lib/jasmine/headless/coffee_script_cache_spec.rb
195
+ - spec/lib/jasmine/headless/coffee_template_spec.rb
196
+ - spec/lib/jasmine/headless/css_template_spec.rb
197
+ - spec/lib/jasmine/headless/files_list_spec.rb
198
+ - spec/lib/jasmine/headless/js_template_spec.rb
199
+ - spec/lib/jasmine/headless/jst_template_spec.rb
163
200
  - spec/lib/jasmine/headless/options_spec.rb
164
201
  - spec/lib/jasmine/headless/report_message/spec_spec.rb
165
202
  - spec/lib/jasmine/headless/report_spec.rb
@@ -167,6 +204,8 @@ files:
167
204
  - spec/lib/jasmine/headless/spec_file_analyzer_spec.rb
168
205
  - spec/lib/jasmine/headless/task_spec.rb
169
206
  - spec/lib/jasmine/headless/template_writer_spec.rb
207
+ - spec/lib/jasmine/headless/unique_asset_list_spec.rb
208
+ - spec/lib/jasmine/headless_spec.rb
170
209
  - spec/lib/qt/qmake_spec.rb
171
210
  - spec/spec_helper.rb
172
211
  - vendor/assets/coffeescripts/headless_reporter_result.coffee
@@ -193,12 +232,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
232
  - - ! '>='
194
233
  - !ruby/object:Gem::Version
195
234
  version: '0'
235
+ segments:
236
+ - 0
237
+ hash: 844055773642571347
196
238
  required_rubygems_version: !ruby/object:Gem::Requirement
197
239
  none: false
198
240
  requirements:
199
- - - ! '>='
241
+ - - ! '>'
200
242
  - !ruby/object:Gem::Version
201
- version: '0'
243
+ version: 1.3.1
202
244
  requirements: []
203
245
  rubyforge_project: jasmine-headless-webkit
204
246
  rubygems_version: 1.8.11
@@ -208,6 +250,9 @@ summary: Run Jasmine specs headlessly in a WebKit browser
208
250
  test_files:
209
251
  - spec/bin/jasmine-headless-webkit_spec.rb
210
252
  - spec/files/UTF-8-test.txt
253
+ - spec/integration/randomization_spec.rb
254
+ - spec/integration/specify_runner_file_spec.rb
255
+ - spec/integration/sprockets_spec.rb
211
256
  - spec/jasmine/click_button/click_button.js
212
257
  - spec/jasmine/click_button/click_button.yml
213
258
  - spec/jasmine/click_button/click_button_spec.js
@@ -236,19 +281,35 @@ test_files:
236
281
  - spec/jasmine/leave_page/leave_page.js
237
282
  - spec/jasmine/leave_page/leave_page.yml
238
283
  - spec/jasmine/leave_page/leave_page_spec.js
284
+ - spec/jasmine/runner_out_in_jasmine_yml/jasmine.yml
285
+ - spec/jasmine/runner_out_in_jasmine_yml/test.js
286
+ - spec/jasmine/runner_out_in_jasmine_yml/test_spec.coffee
239
287
  - spec/jasmine/success/success.js
240
288
  - spec/jasmine/success/success.yml
241
289
  - spec/jasmine/success/success_spec.js
242
290
  - spec/jasmine/success_with_error/success_with_error.js
243
291
  - spec/jasmine/success_with_error/success_with_error.yml
244
292
  - spec/jasmine/success_with_error/success_with_error_spec.js
293
+ - spec/jasmine/with_sprockets_includes/assets/application.js.erb
294
+ - spec/jasmine/with_sprockets_includes/assets/things/code.js
295
+ - spec/jasmine/with_sprockets_includes/assets/things/required.js
296
+ - spec/jasmine/with_sprockets_includes/assets/things/subcode/more_code.js
297
+ - spec/jasmine/with_sprockets_includes/assets/things/templates/that.jst.ejs
298
+ - spec/jasmine/with_sprockets_includes/assets/things/templates/this.jst
299
+ - spec/jasmine/with_sprockets_includes/spec/spec_helper.js
300
+ - spec/jasmine/with_sprockets_includes/spec/things/code_spec.js
301
+ - spec/jasmine/with_sprockets_includes/with_sprockets_includes.yml
302
+ - spec/javascripts/console.log_spec.coffee
245
303
  - spec/javascripts/headless_reporter_result_spec.coffee
246
304
  - spec/javascripts/jasmine.HeadlessConsoleReporter_spec.coffee
247
305
  - spec/javascripts/support/jasmine.yml
248
- - spec/javascripts/support/jquery-1.6.2.min.js
249
- - spec/lib/jasmine/files_list_spec.rb
250
306
  - spec/lib/jasmine/headless/cacheable_action_spec.rb
251
307
  - spec/lib/jasmine/headless/coffee_script_cache_spec.rb
308
+ - spec/lib/jasmine/headless/coffee_template_spec.rb
309
+ - spec/lib/jasmine/headless/css_template_spec.rb
310
+ - spec/lib/jasmine/headless/files_list_spec.rb
311
+ - spec/lib/jasmine/headless/js_template_spec.rb
312
+ - spec/lib/jasmine/headless/jst_template_spec.rb
252
313
  - spec/lib/jasmine/headless/options_spec.rb
253
314
  - spec/lib/jasmine/headless/report_message/spec_spec.rb
254
315
  - spec/lib/jasmine/headless/report_spec.rb
@@ -256,5 +317,7 @@ test_files:
256
317
  - spec/lib/jasmine/headless/spec_file_analyzer_spec.rb
257
318
  - spec/lib/jasmine/headless/task_spec.rb
258
319
  - spec/lib/jasmine/headless/template_writer_spec.rb
320
+ - spec/lib/jasmine/headless/unique_asset_list_spec.rb
321
+ - spec/lib/jasmine/headless_spec.rb
259
322
  - spec/lib/qt/qmake_spec.rb
260
323
  - spec/spec_helper.rb
@@ -1,176 +0,0 @@
1
- require 'jasmine-core'
2
- require 'time'
3
- require 'multi_json'
4
-
5
- module Jasmine
6
- class FilesList
7
- attr_reader :files, :spec_files, :filtered_files, :spec_outside_scope
8
-
9
- class << self
10
- def find_vendored_asset_paths(*names)
11
- require 'rubygems'
12
-
13
- raise StandardError.new("A newer version of Rubygems is required to use vendored assets. Please upgrade.") if !Gem::Specification.respond_to?(:map)
14
- all_spec_files.find_all do |file|
15
- names.any? { |name| file["/#{name}.js"] }
16
- end
17
- end
18
-
19
- def all_spec_files
20
- @all_spec_files ||= Gem::Specification.map { |spec| spec.files.find_all { |file|
21
- file["vendor/assets/javascripts"]
22
- }.compact.collect { |file| File.join(spec.gem_dir, file) } }.flatten
23
- end
24
- end
25
-
26
- DEFAULT_FILES = [
27
- File.join(Jasmine::Core.path, "jasmine.js"),
28
- File.join(Jasmine::Core.path, "jasmine-html.js"),
29
- File.join(Jasmine::Core.path, "jasmine.css")
30
- ] + %w{jasmine-extensions intense headless_reporter_result jasmine.HeadlessConsoleReporter jsDump beautify-html}.collect { |name|
31
- Jasmine::Headless.root.join("vendor/assets/javascripts/#{name}.js").to_s
32
- }
33
-
34
- PLEASE_WAIT_IM_WORKING_TIME = 2
35
-
36
- def initialize(options = {})
37
- @options = options
38
- @files = DEFAULT_FILES.dup
39
- @filtered_files = @files.dup
40
- @spec_outside_scope = false
41
- @spec_files = []
42
- use_config! if config?
43
- end
44
-
45
- def has_spec_outside_scope?
46
- @spec_outside_scope
47
- end
48
-
49
- def filtered?
50
- files != filtered_files
51
- end
52
-
53
- def files_to_html
54
- to_html(files)
55
- end
56
-
57
- def filtered_files_to_html
58
- to_html(filtered_files)
59
- end
60
-
61
- def spec_file_line_numbers
62
- @spec_file_line_numbers ||= Hash[@spec_files.collect { |file|
63
- if File.exist?(file)
64
- if !(lines = Jasmine::Headless::SpecFileAnalyzer.for(file)).empty?
65
- [ file, lines ]
66
- end
67
- else
68
- nil
69
- end
70
- }.compact]
71
- end
72
-
73
- private
74
- def to_html(files)
75
- alert_time = Time.now + PLEASE_WAIT_IM_WORKING_TIME
76
-
77
- files.collect { |file|
78
- if alert_time && alert_time < Time.now
79
- puts "Rebuilding cache, please wait..."
80
- alert_time = nil
81
- end
82
-
83
- source = nil
84
-
85
- result = case File.extname(file)
86
- when '.coffee'
87
- begin
88
- cache = Jasmine::Headless::CoffeeScriptCache.new(file)
89
- source = cache.handle
90
- if cache.cached?
91
- %{<script type="text/javascript" src="#{cache.cache_file}"></script>
92
- <script type="text/javascript">
93
- window.CSTF['#{File.split(cache.cache_file).last}'] = '#{file}';
94
- </script>}
95
- else
96
- %{<script type="text/javascript">#{source}</script>}
97
- end
98
- rescue CoffeeScript::CompilationError => ne
99
- puts "[%s] %s: %s" % [ 'coffeescript'.color(:red), file.color(:yellow), ne.message.to_s.color(:white) ]
100
- raise ne
101
- rescue StandardError => e
102
- puts "[%s] Error in compiling one of the followng: %s" % [ 'coffeescript'.color(:red), files.join(' ').color(:yellow) ]
103
- raise e
104
- end
105
- when '.js'
106
- %{<script type="text/javascript" src="#{file}"></script>}
107
- when '.css'
108
- %{<link rel="stylesheet" href="#{file}" type="text/css" />}
109
- end
110
-
111
- result
112
- }.flatten.compact.reject(&:empty?)
113
- end
114
-
115
- def spec_filter
116
- return @spec_filter if @spec_filter
117
-
118
- @spec_filter = begin
119
- if @options[:only]
120
- @options[:only].collect { |path| expanded_dir(path) }.flatten
121
- else
122
- []
123
- end
124
- end
125
- end
126
-
127
- def use_config!
128
- @filtered_files = @files.dup
129
-
130
- data = @options[:config].dup
131
- [ [ 'src_files', 'src_dir' ], [ 'stylesheets', 'src_dir' ], [ 'vendored_helpers' ], [ 'helpers', 'spec_dir' ], [ 'spec_files', 'spec_dir' ] ].each do |searches, root|
132
- if data[searches]
133
- case searches
134
- when 'vendored_helpers'
135
- data[searches].each do |name|
136
- found_files = self.class.find_vendored_asset_path(name)
137
-
138
- @files += found_files
139
- @filtered_files += found_files
140
- end
141
- else
142
- data[searches].flatten.collect do |search|
143
- path = search
144
- path = File.join(data[root], path) if data[root]
145
- found_files = expanded_dir(path) - @files
146
-
147
- @files += found_files
148
-
149
- if searches == 'spec_files'
150
- @spec_files += spec_filter.empty? ? found_files : (found_files & spec_filter)
151
- end
152
-
153
- @filtered_files += begin
154
- if searches == 'spec_files'
155
- @spec_outside_scope = ((spec_filter | found_files).sort != found_files.sort)
156
- spec_filter.empty? ? found_files : (spec_filter || found_files)
157
- else
158
- found_files
159
- end
160
- end
161
- end
162
- end
163
- end
164
- end
165
- end
166
-
167
- def config?
168
- @options[:config]
169
- end
170
-
171
- def expanded_dir(path)
172
- Dir[path].collect { |file| File.expand_path(file) }
173
- end
174
- end
175
- end
176
-