jasmine 2.99.0 → 3.0.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 +4 -4
- data/.editorconfig +6 -0
- data/.travis.yml +7 -6
- data/Gemfile +5 -7
- data/HOW_TO_TEST.markdown +1 -1
- data/jasmine.gemspec +4 -10
- data/lib/generators/jasmine/install/templates/spec/javascripts/support/jasmine.yml +2 -2
- data/lib/jasmine/asset_expander.rb +1 -22
- data/lib/jasmine/ci_runner.rb +1 -1
- data/lib/jasmine/config.rb +1 -4
- data/lib/jasmine/configuration.rb +3 -1
- data/lib/jasmine/dependencies.rb +2 -7
- data/lib/jasmine/formatters/console.rb +27 -10
- data/lib/jasmine/formatters/exit_code.rb +4 -6
- data/lib/jasmine/result.rb +2 -2
- data/lib/jasmine/version.rb +1 -1
- data/lib/jasmine/yaml_config_parser.rb +9 -1
- data/release_notes/3.0.md +40 -0
- data/spec/ci_runner_spec.rb +12 -0
- data/spec/jasmine_pojs_spec.rb +1 -1
- data/spec/jasmine_rails_spec.rb +6 -14
- data/spec/lib/jasmine/formatters/console_spec.rb +49 -4
- data/spec/lib/jasmine/formatters/exit_code_spec.rb +6 -21
- data/spec/yaml_config_parser_spec.rb +20 -0
- metadata +7 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c18046172c97ada9097c6529f12e5f221e633f67
|
4
|
+
data.tar.gz: 1927874c49d3ecfcdec802f008852e972f2196d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e2e1330b623fb13f52b1244147e238a05992b6df30924672c159de4ab7680b32f64de3d8d515714b40ecb54fa985a2d1dea5ab52ff5f2a01e331fd021ab1261
|
7
|
+
data.tar.gz: a02891ef5cfcdd7f06d287dcc85fa33b480aa0fb864cb67f6e4e46da03a5999937c9dbf70118d05f76585e12c56e09f1fc5dc0e790e51047ae024f7d42b009ff
|
data/.editorconfig
ADDED
data/.travis.yml
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- "
|
5
|
-
- "2.
|
6
|
-
- "2.
|
4
|
+
- "2.3.0"
|
5
|
+
- "2.3.6"
|
6
|
+
- "2.4.1"
|
7
|
+
- "2.5.0"
|
7
8
|
|
8
9
|
env:
|
9
|
-
- "RAILS_VERSION=rails3"
|
10
10
|
- "RAILS_VERSION=rails4"
|
11
11
|
- "RAILS_VERSION=pojs"
|
12
12
|
|
@@ -20,11 +20,11 @@ install:
|
|
20
20
|
matrix:
|
21
21
|
fast_finish: true
|
22
22
|
include:
|
23
|
-
- rvm: "2.3.
|
23
|
+
- rvm: "2.3.4"
|
24
24
|
env:
|
25
25
|
- "PERFORMANCE_SPECS=true"
|
26
26
|
- "RAILS_VERSION=rails5"
|
27
|
-
- rvm: "2.3.
|
27
|
+
- rvm: "2.3.4"
|
28
28
|
env: "RAILS_VERSION=rails5"
|
29
29
|
allow_failures:
|
30
30
|
- rvm: "jruby-9.1.5.0"
|
@@ -33,4 +33,5 @@ matrix:
|
|
33
33
|
- "JRUBY_OPTS=''"
|
34
34
|
|
35
35
|
before_install:
|
36
|
+
- gem update --system
|
36
37
|
- gem install bundler -v "= 1.15.4"
|
data/Gemfile
CHANGED
@@ -3,25 +3,23 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
gem 'anchorman', :platform => :mri
|
6
|
-
|
6
|
+
|
7
7
|
# during development, do not release
|
8
8
|
if ENV['TRAVIS']
|
9
|
-
gem 'jasmine-core', :git => 'http://github.com/jasmine/jasmine.git'
|
9
|
+
gem 'jasmine-core', :git => 'http://github.com/jasmine/jasmine.git', :branch => '3.0-features'
|
10
10
|
else
|
11
11
|
gem 'jasmine-core', :path => '../jasmine'
|
12
12
|
end
|
13
13
|
|
14
|
-
if ENV['RAILS_VERSION'] == "
|
15
|
-
gem 'rack', '1.
|
16
|
-
elsif ENV['RAILS_VERSION'] == "rails4"
|
17
|
-
gem 'rack', '1.5.2'
|
14
|
+
if ENV['RAILS_VERSION'] == "rails4"
|
15
|
+
gem 'rack', '~> 1.6.0'
|
18
16
|
elsif ENV['RAILS_VERSION'] == "pojs"
|
19
17
|
gem 'rack', '< 2.0'
|
20
18
|
else
|
21
19
|
gem 'rack', '>= 2.0'
|
22
20
|
end
|
23
21
|
|
24
|
-
gem 'mime-types', '< 3.0', platform: [:
|
22
|
+
gem 'mime-types', '< 3.0', platform: [:jruby]
|
25
23
|
|
26
24
|
platform :rbx do
|
27
25
|
gem 'json'
|
data/HOW_TO_TEST.markdown
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
To test changes to the jasmine-gem:
|
2
2
|
|
3
3
|
* You need to have the [jasmine project](https://github.com/jasmine/jasmine) checked out in `../jasmine`
|
4
|
-
* Export RAILS_VERSION as either "pojs" (Plain Old JavaScript -- IE, no rails bindings), or "
|
4
|
+
* Export RAILS_VERSION as either "pojs" (Plain Old JavaScript -- IE, no rails bindings), or "rails4" to test environments other than Rails 5.
|
5
5
|
* Delete `Gemfile.lock`
|
6
6
|
* Clear out your current gemset
|
7
7
|
* exec a `bundle install`
|
data/jasmine.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{jasmine}
|
8
8
|
s.version = Jasmine::VERSION
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
|
+
s.required_ruby_version = '>= 2.3'
|
10
11
|
|
11
12
|
s.authors = ["Gregg Van Hove"]
|
12
13
|
s.summary = %q{JavaScript BDD framework}
|
@@ -22,11 +23,9 @@ Gem::Specification.new do |s|
|
|
22
23
|
s.rdoc_options = ["--charset=UTF-8"]
|
23
24
|
|
24
25
|
case ENV['RAILS_VERSION']
|
25
|
-
when 'rails3'
|
26
|
-
s.add_development_dependency 'rails', '>= 3.0.0', '< 4.0.0'
|
27
26
|
when 'pojs'
|
28
27
|
when 'rails4'
|
29
|
-
s.add_development_dependency 'rails', '>= 4', '< 5.0.0'
|
28
|
+
s.add_development_dependency 'rails', '>= 4.2', '< 5.0.0'
|
30
29
|
else #default to rails 5
|
31
30
|
s.add_development_dependency 'rails', '>= 5'
|
32
31
|
end
|
@@ -34,14 +33,9 @@ Gem::Specification.new do |s|
|
|
34
33
|
s.add_development_dependency 'rack-test'
|
35
34
|
s.add_development_dependency 'multi_json'
|
36
35
|
s.add_development_dependency 'rspec', '>= 2.5.0'
|
36
|
+
s.add_development_dependency 'nokogiri'
|
37
37
|
|
38
|
-
|
39
|
-
s.add_development_dependency 'nokogiri', '< 1.7.0'
|
40
|
-
else
|
41
|
-
s.add_development_dependency 'nokogiri'
|
42
|
-
end
|
43
|
-
|
44
|
-
s.add_dependency 'jasmine-core', '>= 2.99.0', '< 3.0.0'
|
38
|
+
s.add_dependency 'jasmine-core', '3.0.0'
|
45
39
|
s.add_dependency 'rack', '>= 1.2.1'
|
46
40
|
s.add_dependency 'rake'
|
47
41
|
s.add_dependency 'phantomjs'
|
@@ -13,29 +13,8 @@ module Jasmine
|
|
13
13
|
UnsupportedRailsVersion = Class.new(StandardError)
|
14
14
|
|
15
15
|
def asset_bundle
|
16
|
-
return Rails3AssetBundle.new if Jasmine::Dependencies.rails3?
|
17
16
|
return Rails4Or5AssetBundle.new if Jasmine::Dependencies.rails4? || Jasmine::Dependencies.rails5?
|
18
|
-
raise UnsupportedRailsVersion, "Jasmine only supports the asset pipeline for Rails
|
19
|
-
end
|
20
|
-
|
21
|
-
class Rails3AssetBundle
|
22
|
-
def assets(pathname)
|
23
|
-
context.asset_paths.asset_for(pathname, nil).to_a.map do |path|
|
24
|
-
context.asset_path(path)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
def context
|
31
|
-
@context ||= get_asset_context
|
32
|
-
end
|
33
|
-
|
34
|
-
def get_asset_context
|
35
|
-
context = ::Rails.application.assets.context_class
|
36
|
-
context.extend(::Sprockets::Helpers::IsolatedHelper)
|
37
|
-
context.extend(::Sprockets::Helpers::RailsHelper)
|
38
|
-
end
|
17
|
+
raise UnsupportedRailsVersion, "Jasmine only supports the asset pipeline for Rails 4 - 5"
|
39
18
|
end
|
40
19
|
|
41
20
|
class Rails4Or5AssetBundle
|
data/lib/jasmine/ci_runner.rb
CHANGED
@@ -16,7 +16,7 @@ module Jasmine
|
|
16
16
|
exit_code_formatter = Jasmine::Formatters::ExitCode.new
|
17
17
|
formatters << exit_code_formatter
|
18
18
|
|
19
|
-
url = "#{config.host}:#{config.port(:ci)}/?throwFailures=#{config.stop_spec_on_expectation_failure}&random=#{@random}#{@seed}"
|
19
|
+
url = "#{config.host}:#{config.port(:ci)}/?throwFailures=#{config.stop_spec_on_expectation_failure}&failFast=#{config.stop_on_spec_failure}&random=#{@random}#{@seed}"
|
20
20
|
runner = config.runner.call(Jasmine::Formatters::Multi.new(formatters), url)
|
21
21
|
|
22
22
|
if runner.respond_to?(:boot_js)
|
data/lib/jasmine/config.rb
CHANGED
@@ -60,10 +60,6 @@ module Jasmine
|
|
60
60
|
# triggers run_load_hooks on action_view which, in turn, causes sprockets/railtie to load the Sprockets asset
|
61
61
|
# helpers and set some configuration options.
|
62
62
|
Rails.application.assets.context_class.instance_eval do
|
63
|
-
if Jasmine::Dependencies.rails3?
|
64
|
-
include ::Sprockets::Helpers::IsolatedHelper
|
65
|
-
include ::Sprockets::Helpers::RailsHelper
|
66
|
-
end
|
67
63
|
if Jasmine::Dependencies.rails4?
|
68
64
|
require 'action_view/base'
|
69
65
|
Rails.application.assets.context_class.assets_prefix = Rails.application.config.assets.prefix
|
@@ -114,6 +110,7 @@ module Jasmine
|
|
114
110
|
|
115
111
|
config.show_console_log = yaml_config.show_console_log
|
116
112
|
config.stop_spec_on_expectation_failure = yaml_config.stop_spec_on_expectation_failure
|
113
|
+
config.stop_on_spec_failure = yaml_config.stop_on_spec_failure
|
117
114
|
config.random = yaml_config.random
|
118
115
|
config.phantom_config_script = yaml_config.phantom_config_script
|
119
116
|
config.phantom_cli_options = yaml_config.phantom_cli_options
|
@@ -13,6 +13,7 @@ module Jasmine
|
|
13
13
|
attr_accessor :prevent_phantom_js_auto_install
|
14
14
|
attr_accessor :show_console_log
|
15
15
|
attr_accessor :stop_spec_on_expectation_failure
|
16
|
+
attr_accessor :stop_on_spec_failure
|
16
17
|
attr_accessor :random
|
17
18
|
attr_accessor :phantom_config_script
|
18
19
|
attr_accessor :phantom_cli_options
|
@@ -36,7 +37,8 @@ module Jasmine
|
|
36
37
|
@rack_options = {}
|
37
38
|
@show_console_log = false
|
38
39
|
@stop_spec_on_expectation_failure = false
|
39
|
-
@
|
40
|
+
@stop_on_spec_failure = false
|
41
|
+
@random = true
|
40
42
|
@phantom_config_script = nil
|
41
43
|
@phantom_cli_options = {}
|
42
44
|
|
data/lib/jasmine/dependencies.rb
CHANGED
@@ -2,10 +2,6 @@ module Jasmine
|
|
2
2
|
module Dependencies
|
3
3
|
|
4
4
|
class << self
|
5
|
-
def rails3?
|
6
|
-
rails? && Rails.version.to_i == 3
|
7
|
-
end
|
8
|
-
|
9
5
|
def rails4?
|
10
6
|
rails? && Rails.version.to_i == 4
|
11
7
|
end
|
@@ -19,9 +15,8 @@ module Jasmine
|
|
19
15
|
end
|
20
16
|
|
21
17
|
def use_asset_pipeline?
|
22
|
-
assets_pipeline_available = (
|
23
|
-
|
24
|
-
assets_pipeline_available && (rails4? || rails5? || rails3_assets_enabled)
|
18
|
+
assets_pipeline_available = (rails4? || rails5?) && Rails.respond_to?(:application) && Rails.application.respond_to?(:assets) && !Rails.application.assets.nil?
|
19
|
+
assets_pipeline_available && (rails4? || rails5?)
|
25
20
|
end
|
26
21
|
end
|
27
22
|
end
|
@@ -44,8 +44,13 @@ module Jasmine
|
|
44
44
|
|
45
45
|
outputter.puts(summary)
|
46
46
|
|
47
|
+
if run_details['overallStatus'] == 'incomplete'
|
48
|
+
outputter.puts("Incomplete: #{run_details['incompleteReason']}")
|
49
|
+
end
|
50
|
+
|
47
51
|
if run_details['order'] && run_details['order']['random']
|
48
|
-
|
52
|
+
seed = run_details['order']['seed']
|
53
|
+
outputter.puts("Randomized with seed #{seed} \(rake jasmine:ci\[true,#{seed}])")
|
49
54
|
end
|
50
55
|
end
|
51
56
|
|
@@ -67,12 +72,22 @@ module Jasmine
|
|
67
72
|
def global_failure_details(run_details)
|
68
73
|
result = Jasmine::Result.new(run_details.merge('fullName' => 'Error occurred in afterAll', 'description' => ''))
|
69
74
|
if (result.failed_expectations.size > 0)
|
70
|
-
|
71
|
-
|
75
|
+
(loadFails, afterAllFails) = result.failed_expectations.partition {|e| e.globalErrorType == 'load' }
|
76
|
+
report_global_failures('Error during loading', loadFails)
|
77
|
+
report_global_failures('Error occurred in afterAll', afterAllFails)
|
72
78
|
end
|
79
|
+
|
73
80
|
result
|
74
81
|
end
|
75
82
|
|
83
|
+
def report_global_failures(prefix, fails)
|
84
|
+
if fails.size > 0
|
85
|
+
fail_result = Jasmine::Result.new('fullName' => prefix, 'description' => '', 'failedExpectations' => fails)
|
86
|
+
outputter.puts(failure_message(fail_result))
|
87
|
+
outputter.puts
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
76
91
|
def chars(results)
|
77
92
|
results.map do |result|
|
78
93
|
if result.succeeded?
|
@@ -100,19 +115,21 @@ module Jasmine
|
|
100
115
|
end
|
101
116
|
|
102
117
|
def failure_message(failure)
|
103
|
-
|
104
|
-
#{failure.full_name}\n
|
105
|
-
FM
|
106
|
-
|
107
|
-
template += failure.failed_expectations.map { |fe| expectation_message(fe) }.join("\n")
|
118
|
+
failure.full_name + "\n" + failure.failed_expectations.map { |fe| expectation_message(fe) }.join("\n")
|
108
119
|
end
|
109
120
|
|
110
121
|
def expectation_message(expectation)
|
111
122
|
<<-FE
|
112
|
-
|
113
|
-
|
123
|
+
Message:
|
124
|
+
\e[31m#{expectation.message}\e[0m
|
125
|
+
Stack:
|
126
|
+
#{stack(expectation.stack)}
|
114
127
|
FE
|
115
128
|
end
|
129
|
+
|
130
|
+
def stack(stack)
|
131
|
+
stack.split("\n").map(&:strip).join("\n ")
|
132
|
+
end
|
116
133
|
end
|
117
134
|
end
|
118
135
|
end
|
@@ -2,20 +2,18 @@ module Jasmine
|
|
2
2
|
module Formatters
|
3
3
|
class ExitCode
|
4
4
|
def initialize
|
5
|
-
@
|
6
|
-
@global_failure = false
|
5
|
+
@result = nil
|
7
6
|
end
|
8
7
|
|
9
8
|
def format(results)
|
10
|
-
@results += results
|
11
9
|
end
|
12
10
|
|
13
|
-
def done(
|
14
|
-
@
|
11
|
+
def done(result)
|
12
|
+
@result = result
|
15
13
|
end
|
16
14
|
|
17
15
|
def succeeded?
|
18
|
-
|
16
|
+
@result && @result['overallStatus'] == 'passed'
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
data/lib/jasmine/result.rb
CHANGED
@@ -49,10 +49,10 @@ module Jasmine
|
|
49
49
|
stack = "No stack trace present."
|
50
50
|
end
|
51
51
|
|
52
|
-
Failure.new(e["message"], stack)
|
52
|
+
Failure.new(e["message"], stack, e["globalErrorType"])
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
class Failure < Struct.new(:message, :stack); end
|
56
|
+
class Failure < Struct.new(:message, :stack, :globalErrorType); end
|
57
57
|
end
|
58
58
|
end
|
data/lib/jasmine/version.rb
CHANGED
@@ -67,8 +67,16 @@ module Jasmine
|
|
67
67
|
loaded_yaml['stop_spec_on_expectation_failure'] || false
|
68
68
|
end
|
69
69
|
|
70
|
+
def stop_on_spec_failure
|
71
|
+
loaded_yaml['stop_on_spec_failure'] || false
|
72
|
+
end
|
73
|
+
|
70
74
|
def random
|
71
|
-
loaded_yaml['random']
|
75
|
+
if loaded_yaml['random'].nil?
|
76
|
+
true
|
77
|
+
else
|
78
|
+
loaded_yaml['random']
|
79
|
+
end
|
72
80
|
end
|
73
81
|
|
74
82
|
def phantom_config_script
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Jasmine Gem 3.0 Release Notes
|
2
|
+
|
3
|
+
## Summary
|
4
|
+
|
5
|
+
Jasmine 3.0 is a major release of Jasmine, and as such includes some breaking changes in addition to various new features.
|
6
|
+
|
7
|
+
Please see the [release notes for Jasmine-Core](https://github.com/jasmine/jasmine/blob/master/release_notes/3.0.md)
|
8
|
+
|
9
|
+
There is also a 2.99 release of Jasmine that will present deprecation warnings for suites that will encounter different behavior in 3.0.
|
10
|
+
|
11
|
+
|
12
|
+
## Changes
|
13
|
+
|
14
|
+
* Remove support for Rails 3. It is no longer supported
|
15
|
+
|
16
|
+
* Allow jasmine:ci task to tell the jasmine suite to fail fast
|
17
|
+
|
18
|
+
* More detailed reporting of suite level errors
|
19
|
+
|
20
|
+
* Drop support for Ruby less than 2.3
|
21
|
+
|
22
|
+
* Report how to re-run Jasmine with the current seed
|
23
|
+
|
24
|
+
* Run specs in random order by default
|
25
|
+
|
26
|
+
* Treat suites with focused specs as failures
|
27
|
+
|
28
|
+
* Distinguish between load errors and afterAll errors
|
29
|
+
|
30
|
+
* Removed gem version specs for Ruby versions less than 2.x
|
31
|
+
|
32
|
+
* Updated the list of Ruby versions that we test against
|
33
|
+
|
34
|
+
* Dropped all versions before 2.2.x as they have reached EOL
|
35
|
+
* Added the latest 2.2.x, 2.3.x, and 2.4.x
|
36
|
+
|
37
|
+
|
38
|
+
------
|
39
|
+
|
40
|
+
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
data/spec/ci_runner_spec.rb
CHANGED
@@ -12,6 +12,7 @@ describe Jasmine::CiRunner do
|
|
12
12
|
:port => '1234',
|
13
13
|
:rack_options => 'rack options',
|
14
14
|
:stop_spec_on_expectation_failure => false,
|
15
|
+
:stop_on_spec_failure => false,
|
15
16
|
:random => false
|
16
17
|
)
|
17
18
|
end
|
@@ -43,6 +44,7 @@ describe Jasmine::CiRunner do
|
|
43
44
|
expect(config).not_to have_received(:port).with(:server)
|
44
45
|
|
45
46
|
expect(runner_factory).to have_received(:call).with(instance_of(Jasmine::Formatters::Multi), /\bthrowFailures=false\b/)
|
47
|
+
expect(runner_factory).to have_received(:call).with(instance_of(Jasmine::Formatters::Multi), /\bfailFast=false\b/)
|
46
48
|
expect(runner_factory).to have_received(:call).with(instance_of(Jasmine::Formatters::Multi), /\brandom=false\b/)
|
47
49
|
|
48
50
|
expect(application_factory).to have_received(:app).with(config)
|
@@ -97,6 +99,16 @@ describe Jasmine::CiRunner do
|
|
97
99
|
expect(runner_factory).to have_received(:call).with(instance_of(Jasmine::Formatters::Multi), /\bthrowFailures=true\b/)
|
98
100
|
end
|
99
101
|
|
102
|
+
it 'can tell the jasmine page to fail fast' do
|
103
|
+
allow(config).to receive(:stop_on_spec_failure) { true }
|
104
|
+
|
105
|
+
ci_runner = Jasmine::CiRunner.new(config, thread: fake_thread, application_factory: application_factory, server_factory: server_factory, outputter: outputter)
|
106
|
+
|
107
|
+
ci_runner.run
|
108
|
+
|
109
|
+
expect(runner_factory).to have_received(:call).with(instance_of(Jasmine::Formatters::Multi), /\bfailFast=true\b/)
|
110
|
+
end
|
111
|
+
|
100
112
|
it 'can tell the jasmine page to randomize' do
|
101
113
|
allow(config).to receive(:random) { true }
|
102
114
|
|
data/spec/jasmine_pojs_spec.rb
CHANGED
@@ -40,7 +40,7 @@ describe "POJS jasmine install" do
|
|
40
40
|
it "should successfully run rake jasmine:ci" do
|
41
41
|
output = `rake jasmine:ci`
|
42
42
|
expect(output).to match (/[1-9]\d* specs, 0 failures/)
|
43
|
-
expect(output).
|
43
|
+
expect(output).to match /Randomized with seed/
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should raise an error when jasmine.yml cannot be found" do
|
data/spec/jasmine_rails_spec.rb
CHANGED
@@ -6,15 +6,9 @@ require 'jasmine/ruby_versions'
|
|
6
6
|
if rails_available?
|
7
7
|
describe 'A Rails app' do
|
8
8
|
def bundle_install
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
if $?.success?
|
13
|
-
tries_remaining = 0
|
14
|
-
else
|
15
|
-
tries_remaining -= 1
|
16
|
-
puts "\n\nBundle failed, trying #{tries_remaining} more times\n\n"
|
17
|
-
end
|
9
|
+
puts `NOKOGIRI_USE_SYSTEM_LIBRARIES=true bundle install --path vendor --retry 3;`
|
10
|
+
unless $?.success?
|
11
|
+
raise "Bundle failed to install."
|
18
12
|
end
|
19
13
|
end
|
20
14
|
|
@@ -32,21 +26,19 @@ if rails_available?
|
|
32
26
|
|
33
27
|
open('Gemfile', 'a') { |f|
|
34
28
|
f.puts "gem 'jasmine', :path => '#{base}'"
|
35
|
-
f.puts "gem 'jasmine-core', :
|
29
|
+
f.puts "gem 'jasmine-core', :git => 'http://github.com/jasmine/jasmine.git', :branch => '3.0-features'"
|
36
30
|
if RUBY_PLATFORM != 'java' && ENV['RAILS_VERSION'] != 'rails5'
|
37
31
|
f.puts "gem 'thin'"
|
38
32
|
end
|
39
33
|
f.puts "gem 'angularjs-rails'"
|
40
34
|
f.puts "gem 'execjs', '2.0.2'"
|
41
|
-
if ruby_version_less_than([2,0,0]) && ENV['RAILS_VERSION'] == 'rails3'
|
42
|
-
f.puts "gem 'sass', '3.4.25'"
|
43
|
-
end
|
44
35
|
f.flush
|
45
36
|
}
|
46
37
|
|
47
38
|
Bundler.with_clean_env do
|
48
39
|
bundle_install
|
49
40
|
`bundle exec rails g jasmine:install`
|
41
|
+
expect($?).to eq 0
|
50
42
|
expect(File.exists?('spec/javascripts/helpers/.gitkeep')).to eq true
|
51
43
|
expect(File.exists?('spec/javascripts/support/jasmine.yml')).to eq true
|
52
44
|
`bundle exec rails g jasmine:examples`
|
@@ -97,7 +89,7 @@ if rails_available?
|
|
97
89
|
jasmine_config['spec_files'] << 'exception_test.js'
|
98
90
|
end
|
99
91
|
output = `bundle exec rake jasmine:ci JASMINE_CONFIG_PATH=#{exception_yaml}`
|
100
|
-
expect($?).
|
92
|
+
expect($?).to_not be_success
|
101
93
|
expect(output).to include('5 specs, 0 failures')
|
102
94
|
end
|
103
95
|
end
|
@@ -162,18 +162,63 @@ describe Jasmine::Formatters::Console do
|
|
162
162
|
console.format(results)
|
163
163
|
console.done({ 'order' => { 'random' => true, 'seed' => '4325' } })
|
164
164
|
|
165
|
-
expect(outputter_output).to match(/Randomized with seed 4325/)
|
165
|
+
expect(outputter_output).to match(/Randomized with seed 4325 \(rake jasmine:ci\[true,4325\]\)/)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
describe 'with loading errors' do
|
170
|
+
it 'should show the errors' do
|
171
|
+
console = Jasmine::Formatters::Console.new(outputter)
|
172
|
+
console.done({ 'failedExpectations' => [
|
173
|
+
{
|
174
|
+
'globalErrorType' => 'load',
|
175
|
+
'message' => 'Load Error',
|
176
|
+
'stack' => 'more info'
|
177
|
+
},
|
178
|
+
{
|
179
|
+
'globalErrorType' => 'load',
|
180
|
+
'message' => 'Another Load Error',
|
181
|
+
'stack' => 'even more info'
|
182
|
+
},
|
183
|
+
] })
|
184
|
+
|
185
|
+
expect(outputter_output).to match(/Error during loading/)
|
186
|
+
expect(outputter_output).to match(/\e\[31mLoad Error\e\[0m\n\s*Stack:\n\s*more info/)
|
187
|
+
expect(outputter_output).to match(/\e\[31mAnother Load Error\e\[0m\n\s*Stack:\n\s*even more info/)
|
166
188
|
end
|
167
189
|
end
|
168
190
|
|
169
191
|
describe 'with errors in a global afterAll' do
|
170
192
|
it 'should show the errors' do
|
171
193
|
console = Jasmine::Formatters::Console.new(outputter)
|
172
|
-
console.done({ 'failedExpectations' => [
|
194
|
+
console.done({ 'failedExpectations' => [
|
195
|
+
{
|
196
|
+
'globalErrorType' => 'afterAll',
|
197
|
+
'message' => 'Global Failure',
|
198
|
+
'stack' => 'more info'
|
199
|
+
},
|
200
|
+
{
|
201
|
+
'globalErrorType' => 'afterAll',
|
202
|
+
'message' => 'Another Failure',
|
203
|
+
'stack' => 'even more info'
|
204
|
+
},
|
205
|
+
] })
|
173
206
|
|
174
207
|
expect(outputter_output).to match(/Error occurred in afterAll/)
|
175
|
-
expect(outputter_output).to match(
|
176
|
-
expect(outputter_output).to match(
|
208
|
+
expect(outputter_output).to match(/\e\[31mGlobal Failure\e\[0m\n\s*Stack:\n\s*more info/)
|
209
|
+
expect(outputter_output).to match(/\e\[31mAnother Failure\e\[0m\n\s*Stack:\n\s*even more info/)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
describe 'when the overall status is incomplete' do
|
214
|
+
it 'shows the reason' do
|
215
|
+
console = Jasmine::Formatters::Console.new(outputter)
|
216
|
+
console.done({
|
217
|
+
'overallStatus' => 'incomplete',
|
218
|
+
'incompleteReason' => 'not all bars were frobnicated'
|
219
|
+
})
|
220
|
+
|
221
|
+
expect(outputter_output).to match(/Incomplete: not all bars were frobnicated/)
|
177
222
|
end
|
178
223
|
end
|
179
224
|
|
@@ -3,32 +3,17 @@ require 'spec_helper'
|
|
3
3
|
describe Jasmine::Formatters::ExitCode do
|
4
4
|
subject(:formatter) { Jasmine::Formatters::ExitCode.new }
|
5
5
|
|
6
|
-
it 'is successful with
|
7
|
-
formatter.done({
|
6
|
+
it 'is successful with an overall status of "passed"' do
|
7
|
+
formatter.done({
|
8
|
+
'overallStatus' => 'passed'
|
9
|
+
})
|
8
10
|
expect(formatter).to be_succeeded
|
9
11
|
end
|
10
12
|
|
11
|
-
it 'is
|
12
|
-
formatter.format([double(:result, failed?: true)])
|
13
|
-
formatter.done({})
|
14
|
-
expect(formatter).not_to be_succeeded
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'finds a single failure to cause the error' do
|
18
|
-
formatter.format([double(failed?: false), double(failed?: false), double(failed?: true), double(failed?: false)])
|
19
|
-
formatter.done({})
|
20
|
-
expect(formatter).not_to be_succeeded
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'is unsuccessful with a failedExpectation in done' do
|
13
|
+
it 'is successful with any other overall status' do
|
24
14
|
formatter.done({
|
25
|
-
'
|
15
|
+
'overallStatus' => 'incomplete'
|
26
16
|
})
|
27
17
|
expect(formatter).not_to be_succeeded
|
28
18
|
end
|
29
|
-
|
30
|
-
it 'is still successful with empty failedExpectations in done' do
|
31
|
-
formatter.done({ 'failedExpectations' => [] })
|
32
|
-
expect(formatter).to be_succeeded
|
33
|
-
end
|
34
19
|
end
|
@@ -101,6 +101,26 @@ describe Jasmine::YamlConfigParser do
|
|
101
101
|
expect(parser.spec_dir).to eq File.join('some_project_root', 'some_spec_dir')
|
102
102
|
end
|
103
103
|
|
104
|
+
it "random returns random if set" do
|
105
|
+
yaml_loader = lambda do |path|
|
106
|
+
if path == "some_path"
|
107
|
+
{"random" => true}
|
108
|
+
end
|
109
|
+
end
|
110
|
+
parser = Jasmine::YamlConfigParser.new('some_path', 'some_project_root', nil, yaml_loader)
|
111
|
+
expect(parser.random).to eq true
|
112
|
+
end
|
113
|
+
|
114
|
+
it "random defaults to true" do
|
115
|
+
yaml_loader = lambda do |path|
|
116
|
+
if path == "some_path"
|
117
|
+
{"random" => nil}
|
118
|
+
end
|
119
|
+
end
|
120
|
+
parser = Jasmine::YamlConfigParser.new('some_path', 'some_project_root', nil, yaml_loader)
|
121
|
+
expect(parser.random).to eq true
|
122
|
+
end
|
123
|
+
|
104
124
|
it "expands src_file paths" do
|
105
125
|
expander = lambda do |dir, patterns|
|
106
126
|
if (dir == File.join('some_project_root', 'some_src') && patterns == ['some_patterns'])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Van Hove
|
@@ -84,20 +84,14 @@ dependencies:
|
|
84
84
|
name: jasmine-core
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 2.99.0
|
90
|
-
- - "<"
|
87
|
+
- - '='
|
91
88
|
- !ruby/object:Gem::Version
|
92
89
|
version: 3.0.0
|
93
90
|
type: :runtime
|
94
91
|
prerelease: false
|
95
92
|
version_requirements: !ruby/object:Gem::Requirement
|
96
93
|
requirements:
|
97
|
-
- -
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 2.99.0
|
100
|
-
- - "<"
|
94
|
+
- - '='
|
101
95
|
- !ruby/object:Gem::Version
|
102
96
|
version: 3.0.0
|
103
97
|
- !ruby/object:Gem::Dependency
|
@@ -150,6 +144,7 @@ executables:
|
|
150
144
|
extensions: []
|
151
145
|
extra_rdoc_files: []
|
152
146
|
files:
|
147
|
+
- ".editorconfig"
|
153
148
|
- ".gitignore"
|
154
149
|
- ".rspec"
|
155
150
|
- ".travis.yml"
|
@@ -205,6 +200,7 @@ files:
|
|
205
200
|
- lib/rack/jasmine/cache_control.rb
|
206
201
|
- lib/rack/jasmine/focused_suite.rb
|
207
202
|
- lib/rack/jasmine/runner.rb
|
203
|
+
- release_notes/3.0.md
|
208
204
|
- release_notes/v1.2.1.md
|
209
205
|
- release_notes/v1.3.2.md
|
210
206
|
- release_notes/v2.0.0.md
|
@@ -271,7 +267,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
271
267
|
requirements:
|
272
268
|
- - ">="
|
273
269
|
- !ruby/object:Gem::Version
|
274
|
-
version: '
|
270
|
+
version: '2.3'
|
275
271
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
276
272
|
requirements:
|
277
273
|
- - ">="
|
@@ -279,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
275
|
version: '0'
|
280
276
|
requirements: []
|
281
277
|
rubyforge_project:
|
282
|
-
rubygems_version: 2.
|
278
|
+
rubygems_version: 2.6.11
|
283
279
|
signing_key:
|
284
280
|
specification_version: 4
|
285
281
|
summary: JavaScript BDD framework
|