jasmine 2.1.0 → 2.2.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: b7ad2fbff53956500c93901508a21b675e40e75c
4
- data.tar.gz: 64d908f89bb6a06594818ee127bd3300ea086753
3
+ metadata.gz: 9f595bb93e25f76eafd50f76f967dff613f67b09
4
+ data.tar.gz: 742260eed0ee7f65a30d0b22a1275bc68b9ab58a
5
5
  SHA512:
6
- metadata.gz: af846c0089929a96cc615687ce90858ed7bd7780694c2a526e5194d11f73ba179c42ba103e47332072e82abe74dcab85b901a0bd8c4b8314e5a4f42beb370866
7
- data.tar.gz: 4010ae21deaba06f30b9d36f70f21533adb5f6527d3bf96cf2d6053e45bd2df29dbcf0fa14eea10f9497d256bb5764a90a5fe83b8f1f4928f702a751ee7607a2
6
+ metadata.gz: 2cb8f13ca4b6e58053517a2c4d92d63e6b5ddf4336fec4e24a182f8ea13ea658a043fe1273302342f75a3484a293886fe67fa1b4e8f6300a8357cf4e7463d4a6
7
+ data.tar.gz: fdcc12240c1bfd77916fc47a1c2ab3add77d5743686b6fc6775a8a42f64881ba845e1006cebc4436daee60aca34823ddaee7965844730f13b117e21461361041
@@ -1,4 +1,4 @@
1
- script: "if [ $PERFORMANCE_SPECS ];then bundle exec rake performance_specs --trace; else bundle exec rake --trace; fi"
1
+ language: ruby
2
2
 
3
3
  rvm:
4
4
  - "1.9.3"
@@ -12,6 +12,13 @@ env:
12
12
  - "RAILS_VERSION=rails4"
13
13
  - "RAILS_VERSION=pojs"
14
14
 
15
+ sudo: false
16
+
17
+ script: "if [ $PERFORMANCE_SPECS ];then bundle exec rake performance_specs --trace; else bundle exec rake --trace; fi"
18
+
19
+ install:
20
+ - bundle install --retry=3
21
+
15
22
  matrix:
16
23
  include:
17
24
  - rvm: "2.0.0"
@@ -1,6 +1,6 @@
1
- # The Jasmine Gem [![Build Status](https://travis-ci.org/pivotal/jasmine-gem.png?branch=master)](https://travis-ci.org/pivotal/jasmine-gem)
1
+ # The Jasmine Gem [![Build Status](https://travis-ci.org/jasmine/jasmine-gem.png?branch=master)](https://travis-ci.org/jasmine/jasmine-gem)
2
2
 
3
- The [Jasmine](http://github.com/pivotal/jasmine) Ruby Gem is a package of helper code for developing Jasmine projects for Ruby-based web projects (Rails, Sinatra, etc.) or for JavaScript projects where Ruby is a welcome partner. It serves up a project's Jasmine suite in a browser so you can focus on your code instead of manually editing script tags in the Jasmine runner HTML file.
3
+ The [Jasmine](http://github.com/jasmine/jasmine) Ruby Gem is a package of helper code for developing Jasmine projects for Ruby-based web projects (Rails, Sinatra, etc.) or for JavaScript projects where Ruby is a welcome partner. It serves up a project's Jasmine suite in a browser so you can focus on your code instead of manually editing script tags in the Jasmine runner HTML file.
4
4
 
5
5
  ## Contents
6
6
  This gem contains:
@@ -19,7 +19,7 @@ end
19
19
 
20
20
  ## Init A Project
21
21
 
22
- To initialize a project for Jasmine
22
+ To initialize a rails project for Jasmine
23
23
 
24
24
  rails g jasmine:install
25
25
 
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency 'rspec', '>= 2.5.0'
34
34
  s.add_development_dependency 'nokogiri'
35
35
 
36
- s.add_dependency 'jasmine-core', '~> 2.1.0'
36
+ s.add_dependency 'jasmine-core', '~> 2.2'
37
37
  s.add_dependency 'rack', '>= 1.2.1'
38
38
  s.add_dependency 'rake'
39
39
  s.add_dependency 'phantomjs'
@@ -79,7 +79,8 @@ module Jasmine
79
79
  jasmine_server_url,
80
80
  @config.prevent_phantom_js_auto_install,
81
81
  @config.show_console_log,
82
- @config.phantom_config_script)
82
+ @config.phantom_config_script,
83
+ @config.show_full_stack_trace)
83
84
  end
84
85
  end
85
86
 
@@ -12,6 +12,7 @@ module Jasmine
12
12
  attr_accessor :prevent_phantom_js_auto_install
13
13
  attr_accessor :show_console_log
14
14
  attr_accessor :phantom_config_script
15
+ attr_accessor :show_full_stack_trace
15
16
  attr_reader :rack_apps
16
17
 
17
18
  def initialize()
@@ -3,11 +3,11 @@ module Jasmine
3
3
 
4
4
  class << self
5
5
  def rails3?
6
- safe_gem_check("rails", "~> 3") && running_rails3?
6
+ safe_gem_check("railties", "~> 3") && running_rails3?
7
7
  end
8
8
 
9
9
  def rails4?
10
- safe_gem_check("rails", "~> 4") && running_rails4?
10
+ safe_gem_check("railties", "~> 4") && running_rails4?
11
11
  end
12
12
 
13
13
  def rails?
@@ -15,7 +15,7 @@ module Jasmine
15
15
  end
16
16
 
17
17
  def rails_available?
18
- safe_gem_check("rails", '>= 3')
18
+ safe_gem_check("railties", '>= 3')
19
19
  end
20
20
 
21
21
  def legacy_rack?
@@ -13,9 +13,20 @@ module Jasmine
13
13
 
14
14
  def done
15
15
  outputter.puts
16
- outputter.puts(failures(@results))
16
+
17
17
  failure_count = results.count(&:failed?)
18
+ if failure_count > 0
19
+ outputter.puts('Failures:')
20
+ outputter.puts(failures(@results))
21
+ outputter.puts
22
+ end
23
+
18
24
  pending_count = results.count(&:pending?)
25
+ if pending_count > 0
26
+ outputter.puts('Pending:')
27
+ outputter.puts(pending(@results))
28
+ outputter.puts
29
+ end
19
30
  summary = "#{pluralize(results.size, 'spec')}, " +
20
31
  "#{pluralize(failure_count, 'failure')}"
21
32
 
@@ -31,6 +42,10 @@ module Jasmine
31
42
  results.select(&:failed?).map { |f| failure_message(f) }.join("\n\n")
32
43
  end
33
44
 
45
+ def pending(results)
46
+ results.select(&:pending?).map { |spec| pending_message(spec) }.join("\n\n")
47
+ end
48
+
34
49
  def chars(results)
35
50
  results.map do |result|
36
51
  if result.succeeded?
@@ -48,6 +63,13 @@ module Jasmine
48
63
  "#{count} #{word}"
49
64
  end
50
65
 
66
+ def pending_message(spec)
67
+ reason = 'No reason given'
68
+ reason = spec.pending_reason if spec.pending_reason && spec.pending_reason != ''
69
+
70
+ "\t#{spec.full_name}\n\t \e[33m#{reason}\e[0m"
71
+ end
72
+
51
73
  def failure_message(failure)
52
74
  template = <<-FM
53
75
  #{failure.full_name}\n
@@ -6,11 +6,13 @@ module Jasmine
6
6
  end
7
7
 
8
8
  def initialize(attrs)
9
+ @show_full_stack_trace = attrs["show_full_stack_trace"]
9
10
  @status = attrs["status"]
10
11
  @full_name = attrs["fullName"]
11
12
  @description = attrs["description"]
12
13
  @failed_expectations = map_failures(attrs["failedExpectations"])
13
14
  @suite_name = full_name.slice(0, full_name.size - description.size - 1)
15
+ @pending_reason = attrs["pendingReason"]
14
16
  end
15
17
 
16
18
  def succeeded?
@@ -25,19 +27,24 @@ module Jasmine
25
27
  status == 'pending'
26
28
  end
27
29
 
28
- attr_reader :full_name, :description, :failed_expectations, :suite_name
30
+ attr_reader :full_name, :description, :failed_expectations, :suite_name, :pending_reason
29
31
 
30
32
  private
31
- attr_reader :status
33
+ attr_reader :status, :show_full_stack_trace
32
34
 
33
35
  def map_failures(failures)
34
36
  failures.map do |e|
35
- short_stack = if e["stack"]
36
- e["stack"].split("\n").slice(0, 7).join("\n")
37
- else
38
- "No stack trace present."
39
- end
40
- Failure.new(e["message"], short_stack)
37
+ if e["stack"]
38
+ if show_full_stack_trace
39
+ stack = e["stack"]
40
+ else
41
+ stack = e["stack"].split("\n").slice(0, 7).join("\n")
42
+ end
43
+ else
44
+ stack = "No stack trace present."
45
+ end
46
+
47
+ Failure.new(e["message"], stack)
41
48
  end
42
49
  end
43
50
 
@@ -3,12 +3,13 @@ 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)
6
+ def initialize(formatter, jasmine_server_url, prevent_phantom_js_auto_install, show_console_log, phantom_config_script, show_full_stack_trace)
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
+ @show_full_stack_trace = show_full_stack_trace
12
13
  end
13
14
 
14
15
  def run
@@ -19,12 +20,12 @@ module Jasmine
19
20
  if line =~ /^jasmine_spec_result/
20
21
  line = line.sub(/^jasmine_spec_result/, '')
21
22
  raw_results = JSON.parse(line, :max_nesting => false)
22
- results = raw_results.map { |r| Result.new(r) }
23
+ results = raw_results.map { |r| Result.new(r.merge!("show_full_stack_trace" => @show_full_stack_trace)) }
23
24
  formatter.format(results)
24
25
  elsif line =~ /^jasmine_suite_result/
25
26
  line = line.sub(/^jasmine_suite_result/, '')
26
27
  raw_results = JSON.parse(line, :max_nesting => false)
27
- results = raw_results.map { |r| Result.new(r) }
28
+ results = raw_results.map { |r| Result.new(r.merge!("show_full_stack_trace" => @show_full_stack_trace)) }
28
29
  failures = results.select(&:failed?)
29
30
  if failures.any?
30
31
  formatter.format(failures)
@@ -33,7 +34,8 @@ module Jasmine
33
34
  config_failure = Result.new('fullName' => line,
34
35
  'failedExpectations' => [],
35
36
  'description' => '',
36
- 'status' => 'failed')
37
+ 'status' => 'failed',
38
+ 'show_full_stack_trace' => @show_full_stack_trace)
37
39
  formatter.format([config_failure])
38
40
  @show_console_log = true
39
41
  puts line
@@ -1,3 +1,3 @@
1
1
  module Jasmine
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
@@ -0,0 +1,31 @@
1
+ # Jasmine Gem 2.2.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updates the jasmine-core dependency to 2.2.0. See the
6
+ [jasmine-core release notes](https://github.com/pivotal/jasmine/blob/master/release_notes/2.2.0.md)
7
+ for more information.
8
+
9
+ ## Changes
10
+
11
+ * Allow minor and patch versions of jasmine-core dependency to change
12
+ * Show pending reason for specs
13
+ * Show section header for failing specs
14
+
15
+ ## Pull Requests & Issues
16
+
17
+ * Add a configuration option to show a full stack trace
18
+ - Merges [#236](https://github.com/jasmine/jasmine/issues/236) from @rrosenblum
19
+
20
+ * Check the railties dependencies instead of rails dependencies
21
+ - Merges [#235](https://github.com/jasmine/jasmine/issues/235) from @shingara
22
+
23
+ * Use the new build env on Travis
24
+ - Merges [#233](https://github.com/jasmine/jasmine/issues/233) from @joshk
25
+
26
+ * More precise readme regarding initialization [ci-skip]
27
+ - Merges [#232](https://github.com/jasmine/jasmine/issues/232) from @Intrepidd
28
+
29
+ ------
30
+
31
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -149,6 +149,14 @@ describe Jasmine::Configuration do
149
149
  end
150
150
  end
151
151
 
152
+ describe 'show full stack trace' do
153
+ it 'returns value if set' do
154
+ config = Jasmine::Configuration.new()
155
+ config.show_full_stack_trace = true
156
+ config.show_full_stack_trace.should == true
157
+ end
158
+ end
159
+
152
160
  describe 'jasmine ports' do
153
161
  it 'returns new CI port and caches return value' do
154
162
  config = Jasmine::Configuration.new()
@@ -63,6 +63,15 @@ describe Jasmine::Formatters::Console do
63
63
  outputter_output.should match(/2 specs/)
64
64
  outputter_output.should match(/2 failures/)
65
65
  end
66
+
67
+ it 'shows the failure message' do
68
+ results = [failing_result]
69
+ console = Jasmine::Formatters::Console.new(outputter)
70
+ console.format(results)
71
+ console.done
72
+
73
+ outputter_output.should match(/a failure message/)
74
+ end
66
75
  end
67
76
 
68
77
  describe 'when there are pending specs' do
@@ -83,6 +92,24 @@ describe Jasmine::Formatters::Console do
83
92
 
84
93
  outputter_output.should match(/2 pending specs/)
85
94
  end
95
+
96
+ it 'shows the pending reason' do
97
+ results = [pending_result]
98
+ console = Jasmine::Formatters::Console.new(outputter)
99
+ console.format(results)
100
+ console.done
101
+
102
+ outputter_output.should match(/I pend because/)
103
+ end
104
+
105
+ it 'shows the default pending reason' do
106
+ results = [Jasmine::Result.new(pending_raw_result.merge('pendingReason' => ''))]
107
+ console = Jasmine::Formatters::Console.new(outputter)
108
+ console.format(results)
109
+ console.done
110
+
111
+ outputter_output.should match(/No reason given/)
112
+ end
86
113
  end
87
114
 
88
115
  describe 'when there are no pending specs' do
@@ -21,6 +21,16 @@ describe Jasmine::Result do
21
21
  expectation.should_not match(/9/)
22
22
  end
23
23
 
24
+ it "exposes the full stack trace when configured" do
25
+ stack_trace = "1\n2\n3\n4\n5\n6\n7\n8\n9"
26
+ raw_result = failing_raw_result
27
+ raw_result["failedExpectations"][0]["stack"] = stack_trace
28
+
29
+ result = Jasmine::Result.new(raw_result.merge!("show_full_stack_trace" => true))
30
+ expectation = result.failed_expectations[0].stack
31
+ expectation.should == stack_trace
32
+ end
33
+
24
34
  it "handles failed specs with no stack trace" do
25
35
  raw_result = failing_result_no_stack_trace
26
36
 
@@ -58,7 +58,7 @@ def passing_raw_result
58
58
  end
59
59
 
60
60
  def pending_raw_result
61
- {'id' => 123, 'status' => 'pending', 'fullName' => 'Passing test', 'description' => 'Pending', 'failedExpectations' => []}
61
+ {'id' => 123, 'status' => 'pending', 'fullName' => 'Passing test', 'description' => 'Pending', 'failedExpectations' => [], 'pendingReason' => 'I pend because'}
62
62
  end
63
63
 
64
64
  def failing_raw_result
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: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajan Agaskar
@@ -10,132 +10,132 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-11-14 00:00:00.000000000 Z
13
+ date: 2015-02-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - '>='
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: '4'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - '>='
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '4'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rack-test
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: multi_json
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rspec
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: 2.5.0
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - '>='
68
+ - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: 2.5.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: nokogiri
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: jasmine-core
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ~>
89
+ - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: 2.1.0
91
+ version: '2.2'
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ~>
96
+ - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: 2.1.0
98
+ version: '2.2'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: rack
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - '>='
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
105
  version: 1.2.1
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - '>='
110
+ - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: 1.2.1
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rake
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - '>='
117
+ - - ">="
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - '>='
124
+ - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: phantomjs
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - '>='
131
+ - - ">="
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - '>='
138
+ - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  description: Test your JavaScript without any framework dependencies, in any environment,
@@ -146,9 +146,9 @@ executables:
146
146
  extensions: []
147
147
  extra_rdoc_files: []
148
148
  files:
149
- - .gitignore
150
- - .rspec
151
- - .travis.yml
149
+ - ".gitignore"
150
+ - ".rspec"
151
+ - ".travis.yml"
152
152
  - Gemfile
153
153
  - HOW_TO_TEST.markdown
154
154
  - MIT.LICENSE
@@ -206,6 +206,7 @@ files:
206
206
  - release_notes/v2.0.2.md
207
207
  - release_notes/v2.0.3.md
208
208
  - release_notes/v2.1.0.md
209
+ - release_notes/v2.2.0.md
209
210
  - spec/application_integration_spec.rb
210
211
  - spec/application_spec.rb
211
212
  - spec/base_spec.rb
@@ -242,22 +243,22 @@ licenses:
242
243
  metadata: {}
243
244
  post_install_message:
244
245
  rdoc_options:
245
- - --charset=UTF-8
246
+ - "--charset=UTF-8"
246
247
  require_paths:
247
248
  - lib
248
249
  required_ruby_version: !ruby/object:Gem::Requirement
249
250
  requirements:
250
- - - '>='
251
+ - - ">="
251
252
  - !ruby/object:Gem::Version
252
253
  version: '0'
253
254
  required_rubygems_version: !ruby/object:Gem::Requirement
254
255
  requirements:
255
- - - '>='
256
+ - - ">="
256
257
  - !ruby/object:Gem::Version
257
258
  version: '0'
258
259
  requirements: []
259
260
  rubyforge_project:
260
- rubygems_version: 2.0.3
261
+ rubygems_version: 2.2.2
261
262
  signing_key:
262
263
  specification_version: 4
263
264
  summary: JavaScript BDD framework