jasmine 2.6.0 → 2.7.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/jasmine.gemspec +2 -12
- data/lib/jasmine/base.rb +1 -1
- data/lib/jasmine/config.rb +4 -5
- data/lib/jasmine/configuration.rb +5 -3
- data/lib/jasmine/dependencies.rb +0 -4
- data/lib/jasmine/ruby_versions.rb +11 -0
- data/lib/jasmine/server.rb +3 -9
- data/lib/jasmine/version.rb +1 -1
- data/release_notes/v2.6.1.md +11 -0
- data/release_notes/v2.7.0.md +28 -0
- data/spec/application_integration_spec.rb +3 -3
- data/spec/application_spec.rb +16 -16
- data/spec/base_spec.rb +13 -11
- data/spec/configuration_spec.rb +29 -27
- data/spec/jasmine_command_line_tool_spec.rb +34 -34
- data/spec/jasmine_pojs_spec.rb +22 -22
- data/spec/jasmine_rails_spec.rb +30 -26
- data/spec/lib/jasmine/formatters/console_spec.rb +20 -20
- data/spec/lib/jasmine/formatters/multi_spec.rb +6 -6
- data/spec/page_spec.rb +2 -2
- data/spec/path_expander_spec.rb +6 -6
- data/spec/path_mapper_spec.rb +10 -10
- data/spec/performance/phantom_js_runner_performance_spec.rb +1 -1
- data/spec/rack/jasmine/runner_spec.rb +2 -2
- data/spec/result_spec.rb +8 -8
- data/spec/server_spec.rb +13 -49
- data/spec/yaml_config_parser_spec.rb +21 -21
- metadata +7 -4
@@ -14,35 +14,35 @@ describe 'Jasmine command line tool' do
|
|
14
14
|
describe 'without a Gemfile' do
|
15
15
|
it 'should create files on init' do
|
16
16
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ['init'] }
|
17
|
-
output.
|
17
|
+
expect(output).to match /Jasmine has been installed\./
|
18
18
|
|
19
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/helpers/.gitkeep')).
|
20
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/support/jasmine.yml')).
|
21
|
-
File.exists?(File.join(@tmp, 'Rakefile')).
|
19
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/helpers/.gitkeep'))).to eq true
|
20
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/support/jasmine.yml'))).to eq true
|
21
|
+
expect(File.exists?(File.join(@tmp, 'Rakefile'))).to eq true
|
22
22
|
ci_output = `rake --trace jasmine:ci`
|
23
|
-
ci_output.
|
23
|
+
expect(ci_output).to match (/0 specs, 0 failures/)
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should not have rails-like paths' do
|
27
27
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ['init'] }
|
28
|
-
output.
|
28
|
+
expect(output).to match /Jasmine has been installed\./
|
29
29
|
|
30
30
|
config = YAML.load_file(File.join(@tmp, 'spec/javascripts/support/jasmine.yml'))
|
31
|
-
config['src_files'].
|
32
|
-
config['stylesheets'].
|
31
|
+
expect(config['src_files']).to eq ['public/javascripts/**/*.js']
|
32
|
+
expect(config['stylesheets']).to eq ['stylesheets/**/*.css']
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should create a new Rakefile if it does not exist' do
|
36
36
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ["init"] }
|
37
|
-
output.
|
38
|
-
File.read(File.join(@tmp, 'Rakefile')).
|
37
|
+
expect(output).to match /Jasmine has been installed\./
|
38
|
+
expect(File.read(File.join(@tmp, 'Rakefile'))).to include('jasmine.rake')
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should append to an existing Rakefile" do
|
42
42
|
FileUtils.cp("#{@old_dir}/spec/fixture/Rakefile", @tmp)
|
43
43
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ["init"] }
|
44
|
-
output.
|
45
|
-
File.read(File.join(@tmp, 'Rakefile')).
|
44
|
+
expect(output).to match /Jasmine has been installed\./
|
45
|
+
expect(File.read(File.join(@tmp, 'Rakefile'))).to include('jasmine_flunk')
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -59,9 +59,9 @@ describe 'Jasmine command line tool' do
|
|
59
59
|
Jasmine::CommandLineTool.new.process ['init']
|
60
60
|
}.to raise_error SystemExit
|
61
61
|
}
|
62
|
-
output.
|
62
|
+
expect(output).to match /attempting to run jasmine init in a Rails project/
|
63
63
|
|
64
|
-
Dir.entries(@tmp).sort.
|
64
|
+
expect(Dir.entries(@tmp).sort).to eq [".", "..", "Gemfile"]
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'should allow the user to override the warning' do
|
@@ -70,10 +70,10 @@ describe 'Jasmine command line tool' do
|
|
70
70
|
Jasmine::CommandLineTool.new.process ['init', '--force']
|
71
71
|
}.not_to raise_error
|
72
72
|
}
|
73
|
-
output.
|
73
|
+
expect(output).to match /Jasmine has been installed\./
|
74
74
|
|
75
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/helpers/.gitkeep')).
|
76
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/support/jasmine.yml')).
|
75
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/helpers/.gitkeep'))).to eq true
|
76
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/support/jasmine.yml'))).to eq true
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
@@ -90,53 +90,53 @@ describe 'Jasmine command line tool' do
|
|
90
90
|
Jasmine::CommandLineTool.new.process ['init']
|
91
91
|
}.not_to raise_error
|
92
92
|
}
|
93
|
-
output.
|
93
|
+
expect(output).to match /Jasmine has been installed\./
|
94
94
|
|
95
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/helpers/.gitkeep')).
|
96
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/support/jasmine.yml')).
|
95
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/helpers/.gitkeep'))).to eq true
|
96
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/support/jasmine.yml'))).to eq true
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
101
|
it 'should install the examples' do
|
102
102
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ['examples'] }
|
103
|
-
output.
|
104
|
-
File.exists?(File.join(@tmp, 'public/javascripts/jasmine_examples/Player.js')).
|
105
|
-
File.exists?(File.join(@tmp, 'public/javascripts/jasmine_examples/Song.js')).
|
106
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/jasmine_examples/PlayerSpec.js')).
|
107
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/helpers/jasmine_examples/SpecHelper.js')).
|
103
|
+
expect(output).to match /Jasmine has installed some examples\./
|
104
|
+
expect(File.exists?(File.join(@tmp, 'public/javascripts/jasmine_examples/Player.js'))).to eq true
|
105
|
+
expect(File.exists?(File.join(@tmp, 'public/javascripts/jasmine_examples/Song.js'))).to eq true
|
106
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/jasmine_examples/PlayerSpec.js'))).to eq true
|
107
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/helpers/jasmine_examples/SpecHelper.js'))).to eq true
|
108
108
|
|
109
109
|
capture_stdout { Jasmine::CommandLineTool.new.process ['init'] }
|
110
110
|
ci_output = `rake --trace jasmine:ci`
|
111
|
-
ci_output.
|
111
|
+
expect(ci_output).to match (/[1-9]\d* specs, 0 failures/)
|
112
112
|
end
|
113
113
|
|
114
114
|
it 'should include license info' do
|
115
115
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ['license'] }
|
116
|
-
output.
|
116
|
+
expect(output).to match /Copyright/
|
117
117
|
end
|
118
118
|
|
119
119
|
it 'should copy boot.js' do
|
120
120
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ['copy_boot_js'] }
|
121
|
-
output.
|
121
|
+
expect(output).to match /Jasmine has copied an example boot.js to spec\/javascripts\/support/
|
122
122
|
|
123
|
-
File.exists?(File.join(@tmp, 'spec/javascripts/support/boot.js')).
|
123
|
+
expect(File.exists?(File.join(@tmp, 'spec/javascripts/support/boot.js'))).to eq true
|
124
124
|
end
|
125
125
|
|
126
126
|
it 'should not overwrite an existing boot.js' do
|
127
127
|
capture_stdout { Jasmine::CommandLineTool.new.process ['copy_boot_js'] }
|
128
128
|
output = capture_stdout { Jasmine::CommandLineTool.new.process ['copy_boot_js'] }
|
129
129
|
|
130
|
-
output.
|
130
|
+
expect(output).to match /already exists/
|
131
131
|
end
|
132
132
|
|
133
133
|
it 'should show help' do
|
134
134
|
no_arg_output = capture_stdout { Jasmine::CommandLineTool.new.process [] }
|
135
|
-
no_arg_output.
|
136
|
-
no_arg_output.
|
135
|
+
expect(no_arg_output).to_not match /unknown command/
|
136
|
+
expect(no_arg_output).to match /Usage:/
|
137
137
|
|
138
138
|
unknown_arg_output = capture_stdout { Jasmine::CommandLineTool.new.process ['blurgh', 'blargh'] }
|
139
|
-
unknown_arg_output.
|
140
|
-
unknown_arg_output.
|
139
|
+
expect(unknown_arg_output).to match /unknown command blurgh blargh/
|
140
|
+
expect(unknown_arg_output).to match /Usage:/
|
141
141
|
end
|
142
142
|
end
|
data/spec/jasmine_pojs_spec.rb
CHANGED
@@ -18,36 +18,36 @@ describe "POJS jasmine install" do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should find the Jasmine configuration files" do
|
21
|
-
File.exists?("spec/javascripts/support/jasmine.yml").
|
21
|
+
expect(File.exists?("spec/javascripts/support/jasmine.yml")).to eq true
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should find the Jasmine example files" do
|
25
|
-
File.exists?("public/javascripts/jasmine_examples/Player.js").
|
26
|
-
File.exists?("public/javascripts/jasmine_examples/Song.js").
|
25
|
+
expect(File.exists?("public/javascripts/jasmine_examples/Player.js")).to eq true
|
26
|
+
expect(File.exists?("public/javascripts/jasmine_examples/Song.js")).to eq true
|
27
27
|
|
28
|
-
File.exists?("spec/javascripts/jasmine_examples/PlayerSpec.js").
|
29
|
-
File.exists?("spec/javascripts/helpers/jasmine_examples/SpecHelper.js").
|
28
|
+
expect(File.exists?("spec/javascripts/jasmine_examples/PlayerSpec.js")).to eq true
|
29
|
+
expect(File.exists?("spec/javascripts/helpers/jasmine_examples/SpecHelper.js")).to eq true
|
30
30
|
|
31
|
-
File.exists?("spec/javascripts/support/jasmine.yml").
|
31
|
+
expect(File.exists?("spec/javascripts/support/jasmine.yml")).to eq true
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should show jasmine rake task" do
|
35
35
|
output = `rake -T`
|
36
|
-
output.
|
37
|
-
output.
|
36
|
+
expect(output).to include("jasmine ")
|
37
|
+
expect(output).to include("jasmine:ci")
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should successfully run rake jasmine:ci" do
|
41
41
|
output = `rake jasmine:ci`
|
42
|
-
output.
|
43
|
-
output.
|
42
|
+
expect(output).to match (/[1-9]\d* specs, 0 failures/)
|
43
|
+
expect(output).to_not match /Randomized with seed/
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should raise an error when jasmine.yml cannot be found" do
|
47
47
|
config_path = 'some/thing/that/doesnt/exist'
|
48
48
|
output = `rake jasmine:ci JASMINE_CONFIG_PATH=#{config_path}`
|
49
|
-
|
50
|
-
output.
|
49
|
+
expect($?).to_not be_success
|
50
|
+
expect(output).to match /Unable to load jasmine config from #{config_path}/
|
51
51
|
end
|
52
52
|
|
53
53
|
it "rake jasmine:ci returns proper exit code when the runner raises" do
|
@@ -59,7 +59,7 @@ describe "POJS jasmine install" do
|
|
59
59
|
FileUtils.cp(File.join(@root, 'spec', 'fixture', 'failing_runner.rb'), failing_runner)
|
60
60
|
|
61
61
|
`rake jasmine:ci JASMINE_CONFIG_PATH=#{failing_yaml}`
|
62
|
-
|
62
|
+
expect($?).to_not be_success
|
63
63
|
end
|
64
64
|
|
65
65
|
context 'with a spec with a console.log' do
|
@@ -69,7 +69,7 @@ describe "POJS jasmine install" do
|
|
69
69
|
|
70
70
|
it 'hides console.log by default' do
|
71
71
|
output = `rake jasmine:ci`
|
72
|
-
output.
|
72
|
+
expect(output).to_not include("I'm in the webpage!")
|
73
73
|
end
|
74
74
|
|
75
75
|
it 'can be told to show console.log' do
|
@@ -77,7 +77,7 @@ describe "POJS jasmine install" do
|
|
77
77
|
jasmine_config['show_console_log'] = true
|
78
78
|
end
|
79
79
|
output = `rake jasmine:ci JASMINE_CONFIG_PATH=#{log_yaml}`
|
80
|
-
output.
|
80
|
+
expect(output).to include("I'm in the webpage!")
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -90,7 +90,7 @@ describe "POJS jasmine install" do
|
|
90
90
|
end
|
91
91
|
|
92
92
|
output = `rake jasmine:ci JASMINE_CONFIG_PATH=#{viewport_yaml}`
|
93
|
-
output.
|
93
|
+
expect(output).to match /[1-9]\d* specs, 0 failures/
|
94
94
|
end
|
95
95
|
|
96
96
|
it 'should throw a useful error when the phantom customization fails' do
|
@@ -100,16 +100,16 @@ describe "POJS jasmine install" do
|
|
100
100
|
end
|
101
101
|
|
102
102
|
output = `rake jasmine:ci JASMINE_CONFIG_PATH=#{bad_phantom_yaml}`
|
103
|
-
|
104
|
-
output.
|
103
|
+
expect($?).to_not be_success
|
104
|
+
expect(output).to match /Failed to configure phantom/
|
105
105
|
end
|
106
106
|
|
107
107
|
it 'should fail correctly with a failure in afterAll' do
|
108
108
|
FileUtils.cp(File.join(@root, 'spec', 'fixture', 'afterall_spec.js'), File.join('spec', 'javascripts'))
|
109
109
|
|
110
110
|
output = `rake jasmine:ci`
|
111
|
-
|
112
|
-
output.
|
111
|
+
expect($?).to_not be_success
|
112
|
+
expect(output).to match /afterAll go boom/
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'should tell jasmine to randomize the execution order' do
|
@@ -118,7 +118,7 @@ describe "POJS jasmine install" do
|
|
118
118
|
end
|
119
119
|
|
120
120
|
output = `rake jasmine:ci JASMINE_CONFIG_PATH=#{randomized_yaml}`
|
121
|
-
|
122
|
-
output.
|
121
|
+
expect($?).to be_success
|
122
|
+
expect(output).to match /Randomized with seed/
|
123
123
|
end
|
124
124
|
end
|
data/spec/jasmine_rails_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'net/http'
|
3
3
|
require 'yaml'
|
4
|
+
require 'jasmine/ruby_versions'
|
4
5
|
|
5
6
|
if rails_available?
|
6
7
|
describe 'A Rails app' do
|
@@ -37,19 +38,22 @@ if rails_available?
|
|
37
38
|
end
|
38
39
|
f.puts "gem 'angularjs-rails'"
|
39
40
|
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
|
40
44
|
f.flush
|
41
45
|
}
|
42
46
|
|
43
47
|
Bundler.with_clean_env do
|
44
48
|
bundle_install
|
45
49
|
`bundle exec rails g jasmine:install`
|
46
|
-
File.exists?('spec/javascripts/helpers/.gitkeep').
|
47
|
-
File.exists?('spec/javascripts/support/jasmine.yml').
|
50
|
+
expect(File.exists?('spec/javascripts/helpers/.gitkeep')).to eq true
|
51
|
+
expect(File.exists?('spec/javascripts/support/jasmine.yml')).to eq true
|
48
52
|
`bundle exec rails g jasmine:examples`
|
49
|
-
File.exists?('app/assets/javascripts/jasmine_examples/Player.js').
|
50
|
-
File.exists?('app/assets/javascripts/jasmine_examples/Song.js').
|
51
|
-
File.exists?('spec/javascripts/jasmine_examples/PlayerSpec.js').
|
52
|
-
File.exists?('spec/javascripts/helpers/jasmine_examples/SpecHelper.js').
|
53
|
+
expect(File.exists?('app/assets/javascripts/jasmine_examples/Player.js')).to eq true
|
54
|
+
expect(File.exists?('app/assets/javascripts/jasmine_examples/Song.js')).to eq true
|
55
|
+
expect(File.exists?('spec/javascripts/jasmine_examples/PlayerSpec.js')).to eq true
|
56
|
+
expect(File.exists?('spec/javascripts/helpers/jasmine_examples/SpecHelper.js')).to eq true
|
53
57
|
end
|
54
58
|
end
|
55
59
|
|
@@ -62,15 +66,15 @@ if rails_available?
|
|
62
66
|
#There's a workaround, but requires setting env vars & jruby opts (non-trivial when inside of a jruby process), so skip for now.
|
63
67
|
Bundler.with_clean_env do
|
64
68
|
output = `bundle exec rake -T`
|
65
|
-
output.
|
66
|
-
output.
|
69
|
+
expect(output).to include('jasmine ')
|
70
|
+
expect(output).to include('jasmine:ci')
|
67
71
|
end
|
68
72
|
end
|
69
73
|
|
70
74
|
it "rake jasmine:ci runs and returns expected results" do
|
71
75
|
Bundler.with_clean_env do
|
72
76
|
output = `bundle exec rake jasmine:ci`
|
73
|
-
output.
|
77
|
+
expect(output).to include('5 specs, 0 failures')
|
74
78
|
end
|
75
79
|
end
|
76
80
|
|
@@ -81,8 +85,8 @@ if rails_available?
|
|
81
85
|
jasmine_config['spec_files'] << 'failing_test.js'
|
82
86
|
end
|
83
87
|
output = `bundle exec rake jasmine:ci JASMINE_CONFIG_PATH=#{failing_yaml}`
|
84
|
-
|
85
|
-
output.
|
88
|
+
expect($?).to_not be_success
|
89
|
+
expect(output).to include('6 specs, 1 failure')
|
86
90
|
end
|
87
91
|
end
|
88
92
|
|
@@ -93,8 +97,8 @@ if rails_available?
|
|
93
97
|
jasmine_config['spec_files'] << 'exception_test.js'
|
94
98
|
end
|
95
99
|
output = `bundle exec rake jasmine:ci JASMINE_CONFIG_PATH=#{exception_yaml}`
|
96
|
-
|
97
|
-
output.
|
100
|
+
expect($?).to be_success
|
101
|
+
expect(output).to include('5 specs, 0 failures')
|
98
102
|
end
|
99
103
|
end
|
100
104
|
|
@@ -106,7 +110,7 @@ if rails_available?
|
|
106
110
|
|
107
111
|
Bundler.with_clean_env do
|
108
112
|
output = `bundle exec rake jasmine:ci JASMINE_CONFIG_PATH=#{coffee_yaml}`
|
109
|
-
output.
|
113
|
+
expect(output).to include('6 specs, 0 failures')
|
110
114
|
end
|
111
115
|
end
|
112
116
|
|
@@ -128,14 +132,14 @@ if rails_available?
|
|
128
132
|
|
129
133
|
run_jasmine_server("JASMINE_CONFIG_PATH=#{css_yaml}") do
|
130
134
|
output = Net::HTTP.get(URI.parse('http://localhost:8888/'))
|
131
|
-
output.
|
132
|
-
output.
|
133
|
-
output.
|
134
|
-
output.
|
135
|
-
output.
|
135
|
+
expect(output).to match(%r{script src.*/assets/jasmine_examples/Player\.js})
|
136
|
+
expect(output).to match(%r{script src=['"]http://ajax\.googleapis\.com/ajax/libs/jquery/1\.11\.0/jquery\.min\.js})
|
137
|
+
expect(output).to match(%r{script src.*/assets/jasmine_examples/Song\.js})
|
138
|
+
expect(output).to match(%r{script src.*angular_helper\.js})
|
139
|
+
expect(output).to match(%r{<link rel=.stylesheet.*?href=./assets/foo\.css\?.*?>})
|
136
140
|
|
137
141
|
output = Net::HTTP.get(URI.parse('http://localhost:8888/__spec__/helpers/angular_helper.js'))
|
138
|
-
output.
|
142
|
+
expect(output).to match(/angular\.mock/)
|
139
143
|
end
|
140
144
|
end
|
141
145
|
|
@@ -147,7 +151,7 @@ if rails_available?
|
|
147
151
|
|
148
152
|
run_jasmine_server do
|
149
153
|
output = Net::HTTP.get(URI.parse('http://localhost:8888/assets/assets_prefix.js'))
|
150
|
-
output.
|
154
|
+
expect(output).to match("/assets")
|
151
155
|
end
|
152
156
|
end
|
153
157
|
|
@@ -162,7 +166,7 @@ if rails_available?
|
|
162
166
|
|
163
167
|
Bundler.with_clean_env do
|
164
168
|
output = `bundle exec rake jasmine:ci JASMINE_CONFIG_PATH=#{yaml}`
|
165
|
-
output.
|
169
|
+
expect(output).to include('1 spec, 0 failures')
|
166
170
|
end
|
167
171
|
end
|
168
172
|
|
@@ -175,13 +179,13 @@ if rails_available?
|
|
175
179
|
Bundler.with_clean_env do
|
176
180
|
default_output = `bundle exec rake jasmine:ci`
|
177
181
|
if ENV['RAILS_VERSION'] == 'rails5' || ENV['RAILS_VERSION'].nil?
|
178
|
-
default_output.
|
182
|
+
expect(default_output).to include('Puma starting')
|
179
183
|
else
|
180
|
-
default_output.
|
184
|
+
expect(default_output).to include('Thin web server')
|
181
185
|
end
|
182
186
|
|
183
187
|
custom_output = `bundle exec rake jasmine:ci JASMINE_CONFIG_PATH=#{rack_yaml} 2>&1`
|
184
|
-
custom_output.
|
188
|
+
expect(custom_output).to include("WEBrick")
|
185
189
|
end
|
186
190
|
end
|
187
191
|
|
@@ -198,7 +202,7 @@ if rails_available?
|
|
198
202
|
`kill -0 #{pid}`
|
199
203
|
unless $?.success?
|
200
204
|
puts "someone else is running a server on port 8888"
|
201
|
-
|
205
|
+
expect($?).to be_success
|
202
206
|
end
|
203
207
|
ensure
|
204
208
|
Process.kill(:SIGINT, pid)
|
@@ -5,8 +5,8 @@ describe Jasmine::Formatters::Console do
|
|
5
5
|
let(:outputter_output) { '' }
|
6
6
|
let(:outputter) do
|
7
7
|
double(:outputter).tap do |o|
|
8
|
-
o.
|
9
|
-
o.
|
8
|
+
allow(o).to receive(:print) { |str| outputter_output << str }
|
9
|
+
allow(o).to receive(:puts) { |str| outputter_output << "#{str}\n" }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
let(:run_details) { { 'order' => { 'random' => false } } }
|
@@ -47,9 +47,9 @@ describe Jasmine::Formatters::Console do
|
|
47
47
|
formatter = Jasmine::Formatters::Console.new(outputter)
|
48
48
|
formatter.format(results)
|
49
49
|
formatter.done(run_details)
|
50
|
-
outputter_output.
|
51
|
-
outputter_output.
|
52
|
-
outputter_output.
|
50
|
+
expect(outputter_output).to match(/a suite with a failing spec/)
|
51
|
+
expect(outputter_output).to match(/a failure message/)
|
52
|
+
expect(outputter_output).to match(/a stack trace/)
|
53
53
|
end
|
54
54
|
|
55
55
|
describe 'when the full suite passes' do
|
@@ -59,8 +59,8 @@ describe Jasmine::Formatters::Console do
|
|
59
59
|
console.format(results)
|
60
60
|
console.done(run_details)
|
61
61
|
|
62
|
-
outputter_output.
|
63
|
-
outputter_output.
|
62
|
+
expect(outputter_output).to match(/1 spec/)
|
63
|
+
expect(outputter_output).to match(/0 failures/)
|
64
64
|
end
|
65
65
|
|
66
66
|
it 'shows the spec counts (pluralized)' do
|
@@ -69,8 +69,8 @@ describe Jasmine::Formatters::Console do
|
|
69
69
|
console.format(results)
|
70
70
|
console.done(run_details)
|
71
71
|
|
72
|
-
outputter_output.
|
73
|
-
outputter_output.
|
72
|
+
expect(outputter_output).to match(/2 specs/)
|
73
|
+
expect(outputter_output).to match(/0 failures/)
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -81,8 +81,8 @@ describe Jasmine::Formatters::Console do
|
|
81
81
|
console.format(results)
|
82
82
|
console.done(run_details)
|
83
83
|
|
84
|
-
outputter_output.
|
85
|
-
outputter_output.
|
84
|
+
expect(outputter_output).to match(/2 specs/)
|
85
|
+
expect(outputter_output).to match(/1 failure/)
|
86
86
|
end
|
87
87
|
|
88
88
|
it 'shows the spec counts (pluralized)' do
|
@@ -91,8 +91,8 @@ describe Jasmine::Formatters::Console do
|
|
91
91
|
console.format(results)
|
92
92
|
console.done(run_details)
|
93
93
|
|
94
|
-
outputter_output.
|
95
|
-
outputter_output.
|
94
|
+
expect(outputter_output).to match(/2 specs/)
|
95
|
+
expect(outputter_output).to match(/2 failures/)
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'shows the failure message' do
|
@@ -101,7 +101,7 @@ describe Jasmine::Formatters::Console do
|
|
101
101
|
console.format(results)
|
102
102
|
console.done(run_details)
|
103
103
|
|
104
|
-
outputter_output.
|
104
|
+
expect(outputter_output).to match(/a failure message/)
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
@@ -112,7 +112,7 @@ describe Jasmine::Formatters::Console do
|
|
112
112
|
console.format(results)
|
113
113
|
console.done(run_details)
|
114
114
|
|
115
|
-
outputter_output.
|
115
|
+
expect(outputter_output).to match(/1 pending spec/)
|
116
116
|
end
|
117
117
|
|
118
118
|
it 'shows the spec counts (pluralized)' do
|
@@ -121,7 +121,7 @@ describe Jasmine::Formatters::Console do
|
|
121
121
|
console.format(results)
|
122
122
|
console.done(run_details)
|
123
123
|
|
124
|
-
outputter_output.
|
124
|
+
expect(outputter_output).to match(/2 pending specs/)
|
125
125
|
end
|
126
126
|
|
127
127
|
it 'shows the pending reason' do
|
@@ -130,7 +130,7 @@ describe Jasmine::Formatters::Console do
|
|
130
130
|
console.format(results)
|
131
131
|
console.done(run_details)
|
132
132
|
|
133
|
-
outputter_output.
|
133
|
+
expect(outputter_output).to match(/I pend because/)
|
134
134
|
end
|
135
135
|
|
136
136
|
it 'shows the default pending reason' do
|
@@ -139,7 +139,7 @@ describe Jasmine::Formatters::Console do
|
|
139
139
|
console.format(results)
|
140
140
|
console.done(run_details)
|
141
141
|
|
142
|
-
outputter_output.
|
142
|
+
expect(outputter_output).to match(/No reason given/)
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
@@ -151,7 +151,7 @@ describe Jasmine::Formatters::Console do
|
|
151
151
|
console.format(results)
|
152
152
|
console.done(run_details)
|
153
153
|
|
154
|
-
outputter_output.
|
154
|
+
expect(outputter_output).to_not match(/pending spec[s]/)
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
@@ -162,7 +162,7 @@ describe Jasmine::Formatters::Console do
|
|
162
162
|
console.format(results)
|
163
163
|
console.done({ 'order' => { 'random' => true, 'seed' => '4325' } })
|
164
164
|
|
165
|
-
outputter_output.
|
165
|
+
expect(outputter_output).to match(/Randomized with seed 4325/)
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|