guard-jasmine 1.15.1 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bca4b769bafa5bfe03973a17312eb2a18afebea1
4
- data.tar.gz: ae5294a61eaf4f7c5c9694a160a316a66c315ed4
3
+ metadata.gz: 53193032b63dd7b6271957ed84d4f210e480c555
4
+ data.tar.gz: 397ee318b045ae2c7afb655bf16024a4e3e05d34
5
5
  SHA512:
6
- metadata.gz: c75ad5d7f77540d49efd89755a8d7cd7c9c1170bbec5ee1b3f5fac6055874706b956e967e221c1f5f98ca3adf1be144c985535e3e148e03c3f3def5056c4e0f0
7
- data.tar.gz: e4f29f936ca7da08c65b4ba2f7f933105dcf1bc60593a79fba941df2d97df8a0183b663ab104fd7d7d459f306d44e3ecc3ad25e4ad34135c387974c019d79760
6
+ metadata.gz: f6eaa3b8cd54eaa1630ca2725faa439210b717e5716db767f99b0d94c34bb53672e73776404210f6f8d54d73a7d07f38d0491f8f42d8bae3f25a35e193950a6f
7
+ data.tar.gz: a35aeebd262c0c02d6cbd588bb2d27222986a0e6133ec0cf5907a19c7ad87276e7a1ec606a7de8171e902266f81ef4ae09ed258861fc048522dd0a53f22cc317
data/README.md CHANGED
@@ -566,14 +566,17 @@ name in opposite to Jasmine).
566
566
  #### Jenkins CI integration
567
567
 
568
568
  You can use the Cobertura format to bring coverage support to Jenkins CI, even that Guard::Jasmine has no built in
569
- support for it. The trick is to preprocess the coverage data with istanbul after the spec run:
569
+ support for it. The trick is to post-process the coverage data with istanbul after the spec run:
570
570
 
571
571
  ```ruby
572
572
  desc "Run all JavaScript specs with Istanbul"
573
573
  task :jscov => :environment do
574
- # Run Jasmine tests with code coverage on and generate Jenkins-compatible Jasmine code coverage
575
- # report file. For some reason does not work if run as 2 separate exec's, so combine into one.
576
- exec('guard-jasmine --coverage --coverage-html --coverage-summary; istanbul report cobertura')
574
+ # Run Jasmine tests with code coverage on and generate Jenkins-compatible Jasmine code coverage report file.
575
+ # Must run assets:clean first to force re-compilation.
576
+ # Make sure to fail this task if there are unit test failures.
577
+ # For some reason does not work if run as separate exec's, so combine into one.
578
+ exec('rake assets:clean; guard-jasmine --coverage --coverage-html --coverage-summary; \
579
+ code=$?; if [ $code != "0" ]; then exit $code; fi; istanbul report cobertura')
577
580
  end
578
581
  ```
579
582
 
@@ -625,45 +628,46 @@ Usage:
625
628
  guard-jasmine spec
626
629
 
627
630
  Options:
628
- -s, [--server=SERVER] # Server to start, either `auto`, `webrick`, `mongrel`, `thin`, `puma`
629
- # `unicorn`, `jasmine_gem` or `none`
630
- # Default: auto
631
- -p, [--port=N] # Server port to use
632
- # Default: Random free port
633
- [--verbose] # Show the server output in the console
634
- -e, [--server-env=SERVER_ENV] # The server environment to use, for example `development`, `test` etc.
635
- # Default: test
636
- [--server-timeout=N] # The number of seconds to wait for the Jasmine spec server
637
- # Default: 15
638
- -b, [--bin=BIN] # The location of the PhantomJS binary
639
- -d, [--spec-dir=SPEC_DIR] # The directory with the Jasmine specs
640
- # Default: spec/javascripts
641
- -u, [--url=URL] # The url of the Jasmine test runner_options
642
- # Default: nil
643
- -t, [--timeout=N] # The maximum time in milliseconds to wait for the spec
644
- # runner to finish
645
- # Default: 10000
646
- [--console=CONSOLE] # Whether to show console.log statements in the spec runner,
647
- # either `always`, `never` or `failure`
648
- # Default: failure
649
- [--errors=ERRORS] # Whether to show errors in the spec runner,
650
- # either `always`, `never` or `failure`
651
- # Default: failure
652
- [--focus] # Specdoc focus to hide successful tests when at least one test fails
653
- # Default: true
654
- [--specdoc=SPECDOC] # Whether to show successes in the spec runner, either `always`, `never` or `failure`
655
- # Default: always
656
- [--coverage] # Whether to enable the coverage support or not
657
- [--coverage-html] # Whether to generate html coverage report. Implies --coverage
658
- [--coverage-summary] # Whether to generate html coverage summary. Implies --coverage
659
- [--statements-threshold=N] # Statements coverage threshold
660
- # Default: 0
661
- [--functions-threshold=N] # Functions coverage threshold
662
- # Default: 0
663
- [--branches-threshold=N] # Branches coverage threshold
664
- # Default: 0
665
- [--lines-threshold=N] # Lines coverage threshold
666
- # Default: 0
631
+ -s, [--server=SERVER] # Server to start, either `auto`, `webrick`, `mongrel`, `thin`, `puma`
632
+ # `unicorn`, `jasmine_gem` or `none`
633
+ # Default: auto
634
+ -p, [--port=N] # Server port to use
635
+ # Default: Random free port
636
+ [--verbose] # Show the server output in the console
637
+ -e, [--server-env=SERVER_ENV] # The server environment to use, for example `development`, `test` etc.
638
+ # Default: test
639
+ [--server-timeout=N] # The number of seconds to wait for the Jasmine spec server
640
+ # Default: 15
641
+ -b, [--bin=BIN] # The location of the PhantomJS binary
642
+ -d, [--spec-dir=SPEC_DIR] # The directory with the Jasmine specs
643
+ # Default: spec/javascripts
644
+ -u, [--url=URL] # The url of the Jasmine test runner_options
645
+ # Default: nil
646
+ -t, [--timeout=N] # The maximum time in milliseconds to wait for the spec
647
+ # runner to finish
648
+ # Default: 10000
649
+ [--console=CONSOLE] # Whether to show console.log statements in the spec runner,
650
+ # either `always`, `never` or `failure`
651
+ # Default: failure
652
+ [--errors=ERRORS] # Whether to show errors in the spec runner,
653
+ # either `always`, `never` or `failure`
654
+ # Default: failure
655
+ [--focus] # Specdoc focus to hide successful tests when at least one test fails
656
+ # Default: true
657
+ [--specdoc=SPECDOC] # Whether to show successes in the spec runner, either `always`, `never` or `failure`
658
+ # Default: always
659
+ [--coverage] # Whether to enable the coverage support or not
660
+ [--coverage-html] # Whether to generate html coverage report. Implies --coverage
661
+ [--coverage-html-dir=REPORT_DIR] # Where to save html coverage reports. Defaults to ./coverage. Implies --coverage-html
662
+ [--coverage-summary] # Whether to generate html coverage summary. Implies --coverage
663
+ [--statements-threshold=N] # Statements coverage threshold
664
+ # Default: 0
665
+ [--functions-threshold=N] # Functions coverage threshold
666
+ # Default: 0
667
+ [--branches-threshold=N] # Branches coverage threshold
668
+ # Default: 0
669
+ [--lines-threshold=N] # Lines coverage threshold
670
+ # Default: 0
667
671
  Run the Jasmine spec runner
668
672
  ```
669
673
 
@@ -760,17 +764,9 @@ Given your configuration, you could also need to set:
760
764
  There are many ways to get your Jasmine specs run within a headless environment. If Guard::Jasmine isn't for you,
761
765
  I recommend to check out these other brilliant Jasmine runners:
762
766
 
763
- ### Guards
764
-
765
- * [guard-jasmine-headless-webkit][], a Guard for [jasmine-headless-webkit][], but doesn't run on JRuby.
766
- * [guard-jasmine-node][] automatically & intelligently executes Jasmine Node.js specs when files are modified.
767
- * [guard-jessie][] allows to automatically run you Jasmine specs under Node.js using Jessie runner.
768
-
769
- ### Standalone
770
-
771
- * [Evergreen][], runs CoffeeScript specs headless, but has no continuous testing support.
772
- * [Jezebel][] a Node.js REPL and continuous test runner for [Jessie][], a Node runner for Jasmine, but has no full
773
- featured browser environment.
767
+ * [guard-konacha][], Automatically run [konacha][] tests through Guard.
768
+ * [guard-teabag][], Guard-Teabag: Run Javascript tests with Guard and all the features of [Teabag][]
769
+ * [Karma][] spectacular Test Runner for JavaScript.
774
770
 
775
771
  ## How to file an issue
776
772
 
@@ -804,6 +800,16 @@ Pull requests are very welcome! Please try to follow these simple rules if appli
804
800
  For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
805
801
  `#guard` (irc.freenode.net).
806
802
 
803
+ ### Open Commit Bit
804
+
805
+ Guard has an open commit bit policy: Anyone with an accepted pull request gets added as a repository collaborator.
806
+ Please try to follow these simple rules:
807
+
808
+ * Commit directly onto the master branch only for typos, improvements to the readme and documentation (please add
809
+ `[ci skip]` to the commit message).
810
+ * Create a feature branch and open a pull-request early for any new features to get feedback.
811
+ * Make sure you adhere to the general pull request rules above.
812
+
807
813
  ### The guard-jasmine-debug executable
808
814
 
809
815
  This Guard comes with a small executable `guard-jasmine-debug` that can be used to run the Jasmine test runner on PhantomJS
@@ -885,14 +891,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
885
891
  [CoffeeScript]: http://jashkenas.github.com/coffee-script/
886
892
  [Rails 3.1 asset pipeline]: http://guides.rubyonrails.org/asset_pipeline.html
887
893
  [Homebrew]: http://mxcl.github.com/homebrew/
888
- [Jezebel]: https://github.com/benrady/jezebel
889
- [Jessie]: https://github.com/futuresimple/jessie
890
- [guard-jasmine-headless-webkit]: https://github.com/johnbintz/guard-jasmine-headless-webkit
891
- [jasmine-headless-webkit]: https://github.com/johnbintz/jasmine-headless-webkit/
892
- [Evergreen]: https://github.com/jnicklas/evergreen
893
894
  [PhantomJS script]: https://github.com/netzpirat/guard-jasmine/blob/master/lib/guard/jasmine/phantomjs/guard-jasmine.coffee
894
895
  [Guard::CoffeeScript]: https://github.com/guard/guard-coffeescript
895
896
  [Sinon.JS]: http://sinonjs.org
896
- [guard-jasmine-node]: https://github.com/guard/guard-jasmine-node
897
- [guard-jessie]: https://github.com/guard/guard-jessie
898
897
  [Rails asset pipeline]: http://guides.rubyonrails.org/asset_pipeline.html
898
+ [guard-konacha]: https://github.com/alexgb/guard-konacha
899
+ [konacha]: https://github.com/jfirebaugh/konacha
900
+ [Karma]: https://github.com/karma-runner/karma
901
+ [guard-teabag]: https://github.com/modeset/guard-teabag
902
+ [Teabag]: https://github.com/modeset/teabag
@@ -22,32 +22,33 @@ module Guard
22
22
  attr_accessor :last_run_failed, :last_failed_paths, :run_all_options
23
23
 
24
24
  DEFAULT_OPTIONS = {
25
- server: :auto,
26
- server_env: ENV['RAILS_ENV'] || 'development',
27
- server_timeout: 60,
28
- port: nil,
29
- rackup_config: nil,
30
- jasmine_url: nil,
31
- timeout: 60,
32
- spec_dir: nil,
33
- notification: true,
34
- hide_success: false,
35
- all_on_start: true,
36
- keep_failed: true,
37
- clean: true,
38
- all_after_pass: true,
39
- max_error_notify: 3,
40
- specdoc: :failure,
41
- console: :failure,
42
- errors: :failure,
43
- focus: true,
44
- coverage: false,
45
- coverage_html: false,
46
- coverage_summary: false,
47
- statements_threshold: 0,
48
- functions_threshold: 0,
49
- branches_threshold: 0,
50
- lines_threshold: 0
25
+ server: :auto,
26
+ server_env: ENV['RAILS_ENV'] || 'development',
27
+ server_timeout: 60,
28
+ port: nil,
29
+ rackup_config: nil,
30
+ jasmine_url: nil,
31
+ timeout: 60,
32
+ spec_dir: nil,
33
+ notification: true,
34
+ hide_success: false,
35
+ all_on_start: true,
36
+ keep_failed: true,
37
+ clean: true,
38
+ all_after_pass: true,
39
+ max_error_notify: 3,
40
+ specdoc: :failure,
41
+ console: :failure,
42
+ errors: :failure,
43
+ focus: true,
44
+ coverage: false,
45
+ coverage_html: false,
46
+ coverage_html_dir: "./coverage",
47
+ coverage_summary: false,
48
+ statements_threshold: 0,
49
+ functions_threshold: 0,
50
+ branches_threshold: 0,
51
+ lines_threshold: 0
51
52
  }
52
53
 
53
54
  # Initialize Guard::Jasmine.
@@ -107,6 +107,11 @@ module Guard
107
107
  default: false,
108
108
  desc: 'Whether to generate html coverage report. Implies --coverage'
109
109
 
110
+ method_option :coverage_html_dir,
111
+ type: :string,
112
+ default: "./coverage",
113
+ desc: 'Where to save html coverage reports. Defaults to ./coverage. Implies --coverage-html'
114
+
110
115
  method_option :coverage_summary,
111
116
  type: :boolean,
112
117
  default: false,
@@ -138,31 +143,32 @@ module Guard
138
143
  # @param [Array<String>] paths the name of the specs to run
139
144
  #
140
145
  def spec(*paths)
141
- runner_options = {}
142
- runner_options[:port] = options.port || CLI.find_free_server_port
143
- runner_options[:spec_dir] = options.spec_dir || (File.exists?(File.join('spec', 'javascripts')) ? File.join('spec', 'javascripts') : 'spec')
144
- runner_options[:server] = options.server.to_sym == :auto ? ::Guard::Jasmine::Server.detect_server(runner_options[:spec_dir]) : options.server.to_sym
145
- runner_options[:jasmine_url] = options.url || "http://localhost:#{ runner_options[:port] }#{ options.server.to_sym == :jasmine_gem ? '/' : '/jasmine' }"
146
- runner_options[:phantomjs_bin] = options.bin || CLI.which('phantomjs')
147
- runner_options[:timeout] = options.timeout
148
- runner_options[:verbose] = options.verbose
149
- runner_options[:server_env] = options.server_env
150
- runner_options[:server_timeout] = options.server_timeout
151
- runner_options[:rackup_config] = options.rackup_config
152
- runner_options[:console] = [:always, :never, :failure].include?(options.console.to_sym) ? options.console.to_sym : :failure
153
- runner_options[:errors] = [:always, :never, :failure].include?(options.errors.to_sym) ? options.errors.to_sym : :failure
154
- runner_options[:specdoc] = [:always, :never, :failure].include?(options.specdoc.to_sym) ? options.specdoc.to_sym : :always
155
- runner_options[:focus] = options.focus
156
- runner_options[:coverage] = options.coverage || options.coverage_html || options.coverage_summary
157
- runner_options[:coverage_html] = options.coverage_html
158
- runner_options[:coverage_summary] = options.coverage_summary
159
- runner_options[:statements_threshold] = options.statements_threshold
160
- runner_options[:functions_threshold] = options.functions_threshold
161
- runner_options[:branches_threshold] = options.branches_threshold
162
- runner_options[:lines_threshold] = options.lines_threshold
163
- runner_options[:notification] = false
164
- runner_options[:hide_success] = true
165
- runner_options[:max_error_notify] = 0
146
+ runner_options = {}
147
+ runner_options[:port] = options.port || CLI.find_free_server_port
148
+ runner_options[:spec_dir] = options.spec_dir || (File.exists?(File.join('spec', 'javascripts')) ? File.join('spec', 'javascripts') : 'spec')
149
+ runner_options[:server] = options.server.to_sym == :auto ? ::Guard::Jasmine::Server.detect_server(runner_options[:spec_dir]) : options.server.to_sym
150
+ runner_options[:jasmine_url] = options.url || "http://localhost:#{ runner_options[:port] }#{ options.server.to_sym == :jasmine_gem ? '/' : '/jasmine' }"
151
+ runner_options[:phantomjs_bin] = options.bin || CLI.which('phantomjs')
152
+ runner_options[:timeout] = options.timeout
153
+ runner_options[:verbose] = options.verbose
154
+ runner_options[:server_env] = options.server_env
155
+ runner_options[:server_timeout] = options.server_timeout
156
+ runner_options[:rackup_config] = options.rackup_config
157
+ runner_options[:console] = [:always, :never, :failure].include?(options.console.to_sym) ? options.console.to_sym : :failure
158
+ runner_options[:errors] = [:always, :never, :failure].include?(options.errors.to_sym) ? options.errors.to_sym : :failure
159
+ runner_options[:specdoc] = [:always, :never, :failure].include?(options.specdoc.to_sym) ? options.specdoc.to_sym : :always
160
+ runner_options[:focus] = options.focus
161
+ runner_options[:coverage] = options.coverage || options.coverage_html || options.coverage_summary || options.coverage_html_dir != "./coverage"
162
+ runner_options[:coverage_html] = options.coverage_html || options.coverage_html_dir != "./coverage"
163
+ runner_options[:coverage_html_dir] = options.coverage_html_dir
164
+ runner_options[:coverage_summary] = options.coverage_summary
165
+ runner_options[:statements_threshold] = options.statements_threshold
166
+ runner_options[:functions_threshold] = options.functions_threshold
167
+ runner_options[:branches_threshold] = options.branches_threshold
168
+ runner_options[:lines_threshold] = options.lines_threshold
169
+ runner_options[:notification] = false
170
+ runner_options[:hide_success] = true
171
+ runner_options[:max_error_notify] = 0
166
172
 
167
173
  paths = [runner_options[:spec_dir]] if paths.empty?
168
174
 
@@ -265,7 +265,7 @@ module Guard
265
265
  check_coverage(options)
266
266
 
267
267
  if options[:coverage_html]
268
- generate_html_report
268
+ generate_html_report(options)
269
269
  end
270
270
  end
271
271
 
@@ -318,9 +318,12 @@ module Guard
318
318
  # Uses the Istanbul text reported to output the result of the
319
319
  # last coverage run.
320
320
  #
321
- def generate_html_report
322
- `#{ which('istanbul') } report --root #{ coverage_root } html #{ coverage_file }`
323
- Formatter.info "Updated HTML report available at: #{ File.join('coverage', 'index.html') }"
321
+ # @param [Hash] options for the HTML report
322
+ #
323
+ def generate_html_report(options)
324
+ report_directory = coverage_report_directory(options)
325
+ `#{ which('istanbul') } report --dir #{ report_directory } --root #{ coverage_root } html #{ coverage_file }`
326
+ Formatter.info "Updated HTML report available at: #{ report_directory }/index.html"
324
327
  end
325
328
 
326
329
  # Uses the Istanbul text-summary reporter to output the
@@ -628,6 +631,15 @@ module Guard
628
631
  def coverage_root
629
632
  File.expand_path(File.join('tmp', 'coverage'))
630
633
  end
634
+
635
+ # Creates and returns the coverage report directory.
636
+ #
637
+ # @param [Hash] options for the coverage report directory
638
+ # @return [String] the coverage report directory
639
+ #
640
+ def coverage_report_directory(options)
641
+ File.expand_path(options[:coverage_html_dir])
642
+ end
631
643
  end
632
644
  end
633
645
  end
@@ -1,6 +1,6 @@
1
1
  module Guard
2
2
  module JasmineVersion
3
3
  # Guard::Jasmine version that is used for the Gem specification
4
- VERSION = '1.15.1'
4
+ VERSION = '1.16.0'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.1
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-10 00:00:00.000000000 Z
11
+ date: 2013-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: tilt
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement