jasmine-coverage 0.1.4 → 0.1.5

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.
@@ -1,5 +1,5 @@
1
1
  module Jasmine
2
2
  module Coverage
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
5
5
  end
@@ -49,11 +49,12 @@ if env =~ /^(development|test)$/
49
49
 
50
50
  :reporters => [['File', "#{output_dir}/rawreport.txt"]]
51
51
  )
52
- errStr = "JSCoverage exited with error code: #{status_code}.\nThis implies one of four things:\n"
52
+ errStr = "JSCoverage exited with error code: #{status_code}.\nThis implies one of five things:\n"
53
53
  errStr = errStr +"0) Your JS files had exactly zero instructions. Are they all blank or just comments?\n"
54
54
  errStr = errStr +"1) A test failed (run bundle exec jasmine:headless to see a better error)\n"
55
55
  errStr = errStr +"2) The sourcecode has a syntax error (which JSLint should find)\n"
56
- errStr = errStr +"3) The source files are being loaded out of sequence (so global variables are not being declared in order)\n"
56
+ errStr = errStr +"3) An error occurred in a deferred block, eg a setTimeout or underscore _.defer. This caused a window error which Jasmine will never see.\n"
57
+ errStr = errStr +"4) The source files are being loaded out of sequence (so global variables are not being declared in order)\n"
57
58
  errStr = errStr +" To check this, run bundle exec jasmine-headless-webkit -l to see the ordering\n"
58
59
  errStr = errStr +"\nIn any case, try running the standard jasmine command to get better errors:\n\nbundle exec jasmine:headless\n"
59
60
  errStr = errStr +"\nFinally, try opening the testrig in firefox to see the tests run in a browser and get a stacktrace. "
@@ -15,11 +15,13 @@ module Jasmine::Headless
15
15
  testrigfolder = Jasmine::Coverage.output_dir+"/testrig"
16
16
  FileUtils.mkdir_p testrigfolder
17
17
 
18
- p "Copying all view files and potential javascript fixture folders so the JS has access to the html fixtures."
19
- FileUtils.mkdir_p "#{testrigfolder}/target/fixtures"
18
+ p "\nCopying all view files and potential javascript fixture folders so the JS has access to the html fixtures.\n"
20
19
  FileUtils.copy_entry("#{Jasmine::Coverage.output_dir}/../../spec", "#{testrigfolder}/spec")
21
20
  FileUtils.copy_entry("#{Jasmine::Coverage.output_dir}/../../app", "#{testrigfolder}/app")
21
+ FileUtils.mkdir_p "#{testrigfolder}/target/fixtures"
22
22
  FileUtils.copy_entry("#{Jasmine::Coverage.output_dir}/../fixtures", "#{testrigfolder}/target/fixtures")
23
+ FileUtils.mkdir_p "#{testrigfolder}/target/views"
24
+ FileUtils.copy_entry("#{Jasmine::Coverage.output_dir}/../views", "#{testrigfolder}/target/views")
23
25
 
24
26
  jss = str.scan(/<script type="text\/javascript" src="(.*)"><\/script>/)
25
27
  jss << str.scan(/<link rel="stylesheet" href="(.*)" type="text\/css" \/>/)
@@ -28,6 +30,14 @@ module Jasmine::Headless
28
30
  jss.each { |s|
29
31
  js = File.basename(s)
30
32
  str.sub!(s, js)
33
+ if File.exists?("#{testrigfolder}/#{js}") && js != 'index.js'
34
+ s = "\n\n*******************************************************************\n"
35
+ s = s + "Cannot copy file '#{js}' into jasmine coverage test rig folder.\n"
36
+ s = s + "There is already another file of that name. You either have two files with the same name (but in different paths)\n"
37
+ s = s + "or your filename is the same as that from a third party vendor.\n"
38
+ s = s + "*******************************************************************\n\n"
39
+ raise s
40
+ end
31
41
  FileUtils.cp(s, testrigfolder)
32
42
  }
33
43
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine-coverage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-08 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jasmine-headless-webkit
@@ -66,12 +66,12 @@ executables: []
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
- - lib/tasks/jscoverage.js
69
+ - lib/jasmine/coverage.rb
70
+ - lib/jasmine/coverage/version.rb
70
71
  - lib/tasks/jasmine_headless_coverage_patches.rb
71
72
  - lib/tasks/jasmine_coverage.rake
73
+ - lib/tasks/jscoverage.js
72
74
  - lib/tasks/coverage_output_generator.js
73
- - lib/jasmine/coverage/version.rb
74
- - lib/jasmine/coverage.rb
75
75
  - README.md
76
76
  homepage: https://github.com/firstbanco/jasmine-coverage
77
77
  licenses: []