jasmine 2.7.0 → 2.8.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52deb510769314254a492ff4249de9f05611b556
4
- data.tar.gz: aea92ab6a204385dfde29409543117dcb4ab4c2e
3
+ metadata.gz: dce5824ff98a45b69356d1237216ce704e6f4ece
4
+ data.tar.gz: aea8fa5a135b9f3e93d35c9cfe214550406c5187
5
5
  SHA512:
6
- metadata.gz: 726c7614bbdafc676f410db7b663688829d397b710b2ddfffbe0be4ffb76ab5cdfd91564245fc2a2cb4e16abcd8e6fcae016fb93716023d94daa31801f0f0b6d
7
- data.tar.gz: 9a21eae3801cc9b3cc648db60a088b9d27417b7d889ce76ff11bdda5dd2a97ba4c60fb4de3157e3990588907ff278556f7127f5591a6a09b0427a65d5284c423
6
+ metadata.gz: 66114efd12806fb943ade76075cc526c56ed614a20150015a7811e825484be30f6c0b17ec08409f22e045a18559eeec7176526968d8a8c55e951421b131bf4c1
7
+ data.tar.gz: 23fe694b931ee99689cc57a14e3f34a0af8777b703d9d66bfe6e1227e8ca3487aecba23cba7329fb12c9c4052cbdcf8491428b2f63062beadd9700675eac960a
@@ -87,9 +87,10 @@ In your jasmine_helper.rb:
87
87
 
88
88
  ## Support
89
89
 
90
+ Documentation: [jasmine.github.io](https://jasmine.github.io)
90
91
  Jasmine Mailing list: [jasmine-js@googlegroups.com](mailto:jasmine-js@googlegroups.com)
91
92
  Twitter: [@jasminebdd](http://twitter.com/jasminebdd)
92
93
 
93
94
  Please file issues here at Github
94
95
 
95
- Copyright (c) 2008-2013 Pivotal Labs. This software is licensed under the MIT License.
96
+ Copyright (c) 2008-2017 Pivotal Labs. This software is licensed under the MIT License.
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  s.add_development_dependency 'nokogiri'
42
42
  end
43
43
 
44
- s.add_dependency 'jasmine-core', '>= 2.7.0', '< 3.0.0'
44
+ s.add_dependency 'jasmine-core', '>= 2.8.0', '< 3.0.0'
45
45
  s.add_dependency 'rack', '>= 1.2.1'
46
46
  s.add_dependency 'rake'
47
47
  s.add_dependency 'phantomjs'
@@ -122,6 +122,16 @@ boot_files:
122
122
  # rack_options:
123
123
  # server: 'thin'
124
124
 
125
+ # phantom_cli_options
126
+ #
127
+ # Extra options to be passed to the phantomjs cli,
128
+ # e.g. to enable localStorage in PhantomJs 2.5
129
+ #
130
+ # EXAMPLE
131
+ #
132
+ # phantom_cli_options:
133
+ # local-storage-quota: 5000
134
+
125
135
  # random
126
136
  #
127
137
  # Run specs in semi-random order.
@@ -30,12 +30,12 @@ module Jasmine
30
30
  true
31
31
  end
32
32
 
33
- def self.wait_for_listener(port, name = "required process", seconds_to_wait = 20)
33
+ def self.wait_for_listener(port, host = "localhost", seconds_to_wait = 20)
34
34
  time_out_at = Time.now + seconds_to_wait
35
35
  until server_is_listening_on "localhost", port
36
36
  sleep 0.1
37
37
  puts "Waiting for #{name} on #{port}..."
38
- raise "#{name} didn't show up on port #{port} after #{seconds_to_wait} seconds." if Time.now > time_out_at
38
+ raise "jasmine server didn't show up on port #{port} after #{seconds_to_wait} seconds." if Time.now > time_out_at
39
39
  end
40
40
  end
41
41
 
@@ -31,7 +31,7 @@ module Jasmine
31
31
  end
32
32
  t.abort_on_exception = true
33
33
 
34
- Jasmine::wait_for_listener(config.port(:ci), 'jasmine server')
34
+ Jasmine::wait_for_listener(config.port(:ci), config.host.sub(/\Ahttps?:\/\//, ''))
35
35
  @outputter.puts 'jasmine server started'
36
36
 
37
37
  runner.run
@@ -80,7 +80,8 @@ module Jasmine
80
80
  @config.prevent_phantom_js_auto_install,
81
81
  @config.show_console_log,
82
82
  @config.phantom_config_script,
83
- @config.show_full_stack_trace)
83
+ @config.show_full_stack_trace,
84
+ @config.phantom_cli_options)
84
85
  end
85
86
  end
86
87
 
@@ -115,6 +116,7 @@ module Jasmine
115
116
  config.stop_spec_on_expectation_failure = yaml_config.stop_spec_on_expectation_failure
116
117
  config.random = yaml_config.random
117
118
  config.phantom_config_script = yaml_config.phantom_config_script
119
+ config.phantom_cli_options = yaml_config.phantom_cli_options
118
120
 
119
121
  config.rack_options = yaml_config.rack_options
120
122
  end
@@ -15,6 +15,7 @@ module Jasmine
15
15
  attr_accessor :stop_spec_on_expectation_failure
16
16
  attr_accessor :random
17
17
  attr_accessor :phantom_config_script
18
+ attr_accessor :phantom_cli_options
18
19
  attr_accessor :show_full_stack_trace
19
20
  attr_reader :rack_apps
20
21
 
@@ -37,6 +38,7 @@ module Jasmine
37
38
  @stop_spec_on_expectation_failure = false
38
39
  @random = false
39
40
  @phantom_config_script = nil
41
+ @phantom_cli_options = {}
40
42
 
41
43
  @formatters = [Jasmine::Formatters::Console]
42
44
 
@@ -3,18 +3,19 @@ require 'phantomjs'
3
3
  module Jasmine
4
4
  module Runners
5
5
  class PhantomJs
6
- def initialize(formatter, jasmine_server_url, prevent_phantom_js_auto_install, show_console_log, phantom_config_script, show_full_stack_trace)
6
+ def initialize(formatter, jasmine_server_url, prevent_phantom_js_auto_install, show_console_log, phantom_config_script, show_full_stack_trace, cli_options = nil)
7
7
  @formatter = formatter
8
8
  @jasmine_server_url = jasmine_server_url
9
9
  @prevent_phantom_js_auto_install = prevent_phantom_js_auto_install
10
10
  @show_console_log = show_console_log
11
11
  @phantom_config_script = phantom_config_script
12
12
  @show_full_stack_trace = show_full_stack_trace
13
+ @cli_options = cli_options || {}
13
14
  end
14
15
 
15
16
  def run
16
17
  phantom_script = File.join(File.dirname(__FILE__), 'phantom_jasmine_run.js')
17
- command = "\"#{phantom_js_path}\" \"#{phantom_script}\" \"#{jasmine_server_url}\" \"#{show_console_log}\" \"#{@phantom_config_script}\""
18
+ command = "\"#{phantom_js_path}\" \"#{cli_options_string}\" \"#{phantom_script}\" \"#{jasmine_server_url}\" \"#{show_console_log}\" \"#{@phantom_config_script}\""
18
19
  run_details = { 'random' => false }
19
20
  IO.popen(command) do |output|
20
21
  output.each do |line|
@@ -59,6 +60,12 @@ module Jasmine
59
60
  File.expand_path('phantom_boot.js', File.dirname(__FILE__))
60
61
  end
61
62
 
63
+ def cli_options_string
64
+ @cli_options.
65
+ map {|(k, v)| "--#{k}=#{v}"}.
66
+ join(' ')
67
+ end
68
+
62
69
  private
63
70
  attr_reader :formatter, :jasmine_server_url, :prevent_phantom_js_auto_install, :show_console_log
64
71
  end
@@ -1,3 +1,3 @@
1
1
  module Jasmine
2
- VERSION = "2.7.0"
2
+ VERSION = "2.8.0"
3
3
  end
@@ -76,6 +76,10 @@ module Jasmine
76
76
  File.join @pwd, loaded_yaml['phantom_config_script']
77
77
  end
78
78
 
79
+ def phantom_cli_options
80
+ loaded_yaml['phantom_cli_options'] || {}
81
+ end
82
+
79
83
  def rack_options
80
84
  loaded_yaml.fetch('rack_options', {}).inject({}) do |memo, (key, value)|
81
85
  memo[key.to_sym] = value
@@ -0,0 +1,21 @@
1
+ # Jasmine Gem 2.8.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updates the jasmine-core dependency to 2.8.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.8.0.md)
7
+ for more information
8
+
9
+ ## Pull Requests & Issues
10
+
11
+ * Add support to pass cli options to the phantomjs command
12
+ - Merges [#290](https://github.com/jasmine/jasmine-gem/issues/290) from @cice
13
+
14
+
15
+ * Listen for the server on the host we're going to load it on
16
+ - Fixes [#269](https://github.com/jasmine/jasmine-gem/issues/269)
17
+
18
+
19
+ ------
20
+
21
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -8,7 +8,7 @@ describe Jasmine::CiRunner do
8
8
  double(:configuration,
9
9
  :runner => runner_factory,
10
10
  :formatters => [],
11
- :host => 'foo.bar.com',
11
+ :host => 'http://foo.bar.com',
12
12
  :port => '1234',
13
13
  :rack_options => 'rack options',
14
14
  :stop_spec_on_expectation_failure => false,
@@ -54,7 +54,7 @@ describe Jasmine::CiRunner do
54
54
  @thread_block.call
55
55
  expect(fake_server).to have_received(:start)
56
56
 
57
- expect(Jasmine).to have_received(:wait_for_listener).with('1234', 'jasmine server')
57
+ expect(Jasmine).to have_received(:wait_for_listener).with('1234', 'foo.bar.com')
58
58
 
59
59
  expect(runner).to have_received(:run)
60
60
  end
@@ -193,7 +193,7 @@ if rails_available?
193
193
  Bundler.with_clean_env do
194
194
  begin
195
195
  pid = IO.popen("bundle exec rake jasmine #{options}").pid
196
- Jasmine::wait_for_listener(8888, 'jasmine server', 60)
196
+ Jasmine::wait_for_listener(8888, 'localhost', 60)
197
197
 
198
198
  # if the process we started is not still running, it's very likely this test
199
199
  # will fail because another server is already running on port 8888
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jasmine::Runners::PhantomJs do
4
+ it 'converts a given cli options hash to a cli arguments string' do
5
+ options = {
6
+ 'local-storage-quota' => 5000,
7
+ 'local-storage-path' => 'tmp/xyz'
8
+ }
9
+
10
+ phantom_js = Jasmine::Runners::PhantomJs.new(nil, nil,nil,nil, nil,nil, options)
11
+
12
+ expect(phantom_js.cli_options_string).to eq('--local-storage-quota=5000 --local-storage-path=tmp/xyz')
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Van Hove
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -86,7 +86,7 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 2.7.0
89
+ version: 2.8.0
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
92
  version: 3.0.0
@@ -96,7 +96,7 @@ dependencies:
96
96
  requirements:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: 2.7.0
99
+ version: 2.8.0
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 3.0.0
@@ -222,6 +222,7 @@ files:
222
222
  - release_notes/v2.6.0.md
223
223
  - release_notes/v2.6.1.md
224
224
  - release_notes/v2.7.0.md
225
+ - release_notes/v2.8.0.md
225
226
  - spec/application_integration_spec.rb
226
227
  - spec/application_spec.rb
227
228
  - spec/base_spec.rb
@@ -249,6 +250,7 @@ files:
249
250
  - spec/path_expander_spec.rb
250
251
  - spec/path_mapper_spec.rb
251
252
  - spec/performance/phantom_js_runner_performance_spec.rb
253
+ - spec/phantom_js_spec.rb
252
254
  - spec/rack/jasmine/runner_spec.rb
253
255
  - spec/result_spec.rb
254
256
  - spec/server_spec.rb
@@ -307,6 +309,7 @@ test_files:
307
309
  - spec/path_expander_spec.rb
308
310
  - spec/path_mapper_spec.rb
309
311
  - spec/performance/phantom_js_runner_performance_spec.rb
312
+ - spec/phantom_js_spec.rb
310
313
  - spec/rack/jasmine/runner_spec.rb
311
314
  - spec/result_spec.rb
312
315
  - spec/server_spec.rb