evergreen 1.0.0 → 1.0.1
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 +15 -0
- data/README.rdoc +8 -6
- data/lib/evergreen.rb +8 -6
- data/lib/evergreen/application.rb +2 -5
- data/lib/evergreen/helper.rb +33 -0
- data/lib/evergreen/runner.rb +1 -1
- data/lib/evergreen/server.rb +1 -0
- data/lib/evergreen/suite.rb +6 -0
- data/lib/evergreen/version.rb +1 -1
- data/lib/evergreen/views/run.erb +16 -6
- data/lib/jasmine/Contribute.markdown +8 -7
- data/lib/jasmine/Gemfile +0 -1
- data/lib/jasmine/README.markdown +1 -8
- data/lib/jasmine/Rakefile +26 -15
- data/lib/jasmine/Release.markdown +8 -6
- data/lib/jasmine/config.rb +29 -0
- data/lib/jasmine/jasmine-core.gemspec +9 -2
- data/lib/jasmine/jasmine_dev.thor +1 -0
- data/lib/jasmine/jshint/run.js +1 -1
- data/lib/jasmine/lib/jasmine-core/jasmine-html.js +427 -1
- data/lib/jasmine/lib/jasmine-core/jasmine.css +81 -166
- data/lib/jasmine/lib/jasmine-core/jasmine.js +245 -192
- data/lib/jasmine/lib/jasmine-core/version.rb +1 -1
- data/lib/jasmine/spec/core/MatchersSpec.js +273 -0
- data/lib/jasmine/spec/core/PrettyPrintSpec.js +7 -0
- data/lib/jasmine/spec/html/HTMLReporterSpec.js +209 -0
- data/lib/jasmine/spec/node_suite.js +2 -2
- data/lib/jasmine/spec/runner.html +10 -3
- data/lib/jasmine/spec/spec_helper.rb +51 -0
- data/lib/jasmine/spec/tasks/build_distribution_spec.rb +33 -0
- data/lib/jasmine/spec/tasks/build_github_pages_spec.rb +69 -0
- data/lib/jasmine/spec/tasks/build_standalone_distribution_spec.rb +109 -0
- data/lib/jasmine/spec/tasks/build_standalone_runner_spec.rb +63 -0
- data/lib/jasmine/spec/tasks/count_specs_spec.rb +26 -0
- data/lib/jasmine/spec/tasks/execute_specs_spec.rb +81 -0
- data/lib/jasmine/spec/tasks/jshint_spec.rb +39 -0
- data/lib/jasmine/spec/tasks/release_spec.rb +39 -0
- data/lib/jasmine/spec/tasks/version_spec.rb +55 -0
- data/lib/jasmine/spec/templates/runner.html.erb +3 -3
- data/lib/jasmine/src/core/Env.js +10 -2
- data/lib/jasmine/src/core/Matchers.js +33 -4
- data/lib/jasmine/src/core/PrettyPrinter.js +2 -2
- data/lib/jasmine/src/core/base.js +15 -0
- data/lib/jasmine/src/core/mock-timeout.js +0 -0
- data/lib/jasmine/src/html/HtmlReporter.js +101 -0
- data/lib/jasmine/src/html/HtmlReporterHelpers.js +60 -0
- data/lib/jasmine/src/html/ReporterView.js +164 -0
- data/lib/jasmine/src/html/SpecView.js +79 -0
- data/lib/jasmine/src/html/SuiteView.js +22 -0
- data/lib/jasmine/src/html/TrivialReporter.js +3 -1
- data/lib/jasmine/src/html/_HTMLReporter.scss +302 -0
- data/lib/jasmine/src/html/_TrivialReporter.scss +169 -0
- data/lib/jasmine/src/html/jasmine.css +81 -166
- data/lib/jasmine/src/html/jasmine.scss +2 -0
- data/lib/jasmine/src/templates/version.js.erb +1 -0
- data/lib/jasmine/src/version.js +3 -2
- data/lib/jasmine/src/version.json +1 -1
- data/lib/jasmine/tasks/jasmine_dev.rb +18 -0
- data/lib/jasmine/tasks/jasmine_dev/base.rb +54 -0
- data/lib/jasmine/tasks/jasmine_dev/build_distribution.rb +53 -0
- data/lib/jasmine/tasks/jasmine_dev/build_github_pages.rb +31 -0
- data/lib/jasmine/tasks/jasmine_dev/build_standalone_distribution.rb +49 -0
- data/lib/jasmine/tasks/jasmine_dev/build_standalone_runner.rb +59 -0
- data/lib/jasmine/tasks/jasmine_dev/count_specs.rb +29 -0
- data/lib/jasmine/tasks/jasmine_dev/execute_specs.rb +52 -0
- data/lib/jasmine/tasks/jasmine_dev/js_hint.rb +13 -0
- data/lib/jasmine/tasks/jasmine_dev/release.rb +16 -0
- data/lib/jasmine/tasks/jasmine_dev/sources.rb +32 -0
- data/lib/jasmine/tasks/jasmine_dev/version.rb +62 -0
- data/spec/helper_spec.rb +25 -0
- data/spec/suite1/spec/javascripts/{spec_helper.coffee → helpers/spec_helper.coffee} +0 -0
- data/spec/suite1/spec/javascripts/{spec_helper.js → helpers/spec_helper.js} +0 -0
- data/spec/suite1/spec/javascripts/templates_spec.js +6 -6
- data/spec/suite2/spec/awesome_spec.js +1 -1
- data/spec/suite_spec.rb +6 -0
- metadata +116 -52
- data/lib/jasmine/src/SourcesList.json +0 -7
- data/lib/jasmine/tasks/build_dist.rb +0 -48
- data/lib/jasmine/tasks/build_specs.rb +0 -50
- data/lib/jasmine/tasks/helpers.rb +0 -50
- data/lib/jasmine/tasks/pages.rb +0 -13
- data/lib/jasmine/tasks/spec.rb +0 -37
- data/lib/jasmine/tasks/standalone.rb +0 -91
- data/lib/jasmine/tasks/version.rb +0 -5
@@ -1,5 +1,5 @@
|
|
1
1
|
var fs = require('fs');
|
2
|
-
var
|
2
|
+
var util = require('util');
|
3
3
|
var path = require('path');
|
4
4
|
|
5
5
|
// yes, really keep this here to keep us honest, but only for jasmine's own runner! [xw]
|
@@ -37,7 +37,7 @@ jasmine.executeSpecs = function(specs, done, isVerbose, showColors) {
|
|
37
37
|
}
|
38
38
|
|
39
39
|
var jasmineEnv = jasmine.getEnv();
|
40
|
-
var consoleReporter = new jasmine.ConsoleReporter(
|
40
|
+
var consoleReporter = new jasmine.ConsoleReporter(util.print, done, showColors);
|
41
41
|
|
42
42
|
jasmineEnv.addReporter(consoleReporter);
|
43
43
|
jasmineEnv.execute();
|
@@ -15,6 +15,12 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
<!-- include source files here... -->
|
18
|
+
<script type="text/javascript" src=".././src/html/HtmlReporterHelpers.js"></script>
|
19
|
+
<script type="text/javascript" src=".././src/html/HtmlReporter.js"></script>
|
20
|
+
<script type="text/javascript" src=".././src/html/HtmlReporterHelpers.js"></script>
|
21
|
+
<script type="text/javascript" src=".././src/html/ReporterView.js"></script>
|
22
|
+
<script type="text/javascript" src=".././src/html/SpecView.js"></script>
|
23
|
+
<script type="text/javascript" src=".././src/html/SuiteView.js"></script>
|
18
24
|
<script type="text/javascript" src=".././src/html/TrivialReporter.js"></script>
|
19
25
|
<script type="text/javascript" src=".././src/console/ConsoleReporter.js"></script>
|
20
26
|
|
@@ -38,6 +44,7 @@
|
|
38
44
|
<script type="text/javascript" src=".././spec/core/SuiteSpec.js"></script>
|
39
45
|
<script type="text/javascript" src=".././spec/core/UtilSpec.js"></script>
|
40
46
|
<script type="text/javascript" src=".././spec/core/WaitsForBlockSpec.js"></script>
|
47
|
+
<script type="text/javascript" src=".././spec/html/HTMLReporterSpec.js"></script>
|
41
48
|
<script type="text/javascript" src=".././spec/html/MatchersHtmlSpec.js"></script>
|
42
49
|
<script type="text/javascript" src=".././spec/html/PrettyPrintHtmlSpec.js"></script>
|
43
50
|
<script type="text/javascript" src=".././spec/html/TrivialReporterSpec.js"></script>
|
@@ -48,12 +55,12 @@
|
|
48
55
|
var jasmineEnv = jasmine.getEnv();
|
49
56
|
jasmineEnv.updateInterval = 1000;
|
50
57
|
|
51
|
-
var
|
58
|
+
var htmlReporter = new jasmine.HtmlReporter();
|
52
59
|
|
53
|
-
jasmineEnv.addReporter(
|
60
|
+
jasmineEnv.addReporter(htmlReporter);
|
54
61
|
|
55
62
|
jasmineEnv.specFilter = function(spec) {
|
56
|
-
return
|
63
|
+
return htmlReporter.specFilter(spec);
|
57
64
|
};
|
58
65
|
|
59
66
|
var currentWindowOnload = window.onload;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper.rb"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
#
|
6
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
9
|
+
config.run_all_when_everything_filtered = true
|
10
|
+
config.filter_run :focus
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'awesome_print'
|
14
|
+
require 'tmpdir'
|
15
|
+
require 'nokogiri'
|
16
|
+
|
17
|
+
def project_root
|
18
|
+
File.join(File.expand_path(File.dirname(__FILE__)), '..')
|
19
|
+
end
|
20
|
+
|
21
|
+
require "#{project_root}/tasks/jasmine_dev"
|
22
|
+
|
23
|
+
def capture_output(capture = true)
|
24
|
+
if capture
|
25
|
+
output = StringIO.new
|
26
|
+
$stdout = output
|
27
|
+
end
|
28
|
+
yield
|
29
|
+
if capture
|
30
|
+
output.string
|
31
|
+
end
|
32
|
+
ensure
|
33
|
+
$stdout = STDOUT
|
34
|
+
end
|
35
|
+
|
36
|
+
def reset_dir(dir)
|
37
|
+
FileUtils.rm_r dir if File.exists?(dir)
|
38
|
+
FileUtils.mkdir_p dir
|
39
|
+
end
|
40
|
+
|
41
|
+
def jasmine_version
|
42
|
+
version = jasmine_version_object
|
43
|
+
|
44
|
+
version_string = "#{version['major']}.#{version['minor']}.#{version['build']}"
|
45
|
+
version_string += ".rc#{version['release_candidate']}" if version['release_candidate']
|
46
|
+
version_string
|
47
|
+
end
|
48
|
+
|
49
|
+
def jasmine_version_object
|
50
|
+
@version_object ||= JSON.parse(File.read(File.join(JasmineDev.project_root, 'src', 'version.json')))
|
51
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe "Build Jasmine task" do
|
4
|
+
|
5
|
+
let(:jasmine_core_dir) { "#{Dir.tmpdir}/jasmine-core" }
|
6
|
+
let(:jasmine_dev) { JasmineDev.new }
|
7
|
+
|
8
|
+
before do
|
9
|
+
reset_dir jasmine_core_dir
|
10
|
+
@output = capture_output { jasmine_dev.build_distribution jasmine_core_dir }
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should say that JSHint is running" do
|
14
|
+
@output.should match(/Running JSHint/)
|
15
|
+
@output.should match(/Jasmine JSHint PASSED/)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should tell the developer it is building the distribution" do
|
19
|
+
@output.should match(/Building Jasmine distribution/)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should build jasmine.js in the destination directory" do
|
23
|
+
File.exist?("#{jasmine_core_dir}/jasmine.js").should be_true
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should build jasmine-html.js in the destination directory" do
|
27
|
+
File.exist?("#{jasmine_core_dir}/jasmine-html.js").should be_true
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should build jasmine.css" do
|
31
|
+
File.exist?("#{jasmine_core_dir}/jasmine.css").should be_true
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe "Build Github Pages task" do
|
4
|
+
|
5
|
+
let(:pages_dir) { File.join(Dir.tmpdir, 'pages') }
|
6
|
+
let(:jasmine_dev) { JasmineDev.new }
|
7
|
+
|
8
|
+
before do
|
9
|
+
reset_dir pages_dir
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "when the Github pages submodule is not present" do
|
13
|
+
before do
|
14
|
+
jasmine_dev.should_receive(:has_pages_submodule?).and_return(false)
|
15
|
+
|
16
|
+
@output = capture_output { jasmine_dev.build_github_pages pages_dir }
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should tell the user the task is running" do
|
20
|
+
@output.should match(/Building Github Pages/)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should prompt the user to install the submodule" do
|
24
|
+
@output.should match(/Submodule for Github Pages isn't present/)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "when the Github pages submodule is present" do
|
29
|
+
before do
|
30
|
+
jasmine_dev.should_receive(:has_pages_submodule?).and_return(true)
|
31
|
+
|
32
|
+
@output = capture_output { jasmine_dev.build_github_pages pages_dir }
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should tell the user the task is running" do
|
36
|
+
@output.should match(/Building Github Pages/)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should tell the user the pages are built" do
|
40
|
+
@output.should match(/Congratulations, project dumped to/)
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should build the pages output to the requested diretory" do
|
44
|
+
Dir.chdir File.join(pages_dir, 'pages_output') do
|
45
|
+
pages = Dir.glob(File.join('**', '*'))
|
46
|
+
|
47
|
+
pages.should include('download.html')
|
48
|
+
pages.should include('index.html')
|
49
|
+
pages.should include(File.join('images', 'jasmine_logo.png'))
|
50
|
+
pages.should include(File.join('images', 'pivotal_logo.gif'))
|
51
|
+
pages.should include(File.join('css', 'pygments.css'))
|
52
|
+
pages.should include(File.join('css', 'screen.css'))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should copy the generated page files to the destination directory" do
|
57
|
+
Dir.chdir pages_dir do
|
58
|
+
pages = Dir.glob(File.join('**', '*'))
|
59
|
+
|
60
|
+
pages.should include('download.html')
|
61
|
+
pages.should include('index.html')
|
62
|
+
pages.should include(File.join('images', 'jasmine_logo.png'))
|
63
|
+
pages.should include(File.join('images', 'pivotal_logo.gif'))
|
64
|
+
pages.should include(File.join('css', 'pygments.css'))
|
65
|
+
pages.should include(File.join('css', 'screen.css'))
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe "Standalone Distribution tasks" do
|
4
|
+
|
5
|
+
let(:jasmine_dev) { JasmineDev.new }
|
6
|
+
let(:standalone_temp_dir) { File.join(Dir.tmpdir, 'jasmine_test') }
|
7
|
+
let(:download_dir) { File.join(standalone_temp_dir, 'download')}
|
8
|
+
|
9
|
+
describe "build_standalone_distribution" do
|
10
|
+
before do
|
11
|
+
reset_dir standalone_temp_dir
|
12
|
+
reset_dir download_dir
|
13
|
+
|
14
|
+
Dir.should_receive(:tmpdir).any_number_of_times.and_return(standalone_temp_dir)
|
15
|
+
|
16
|
+
@standalone_staging_dir = File.join(standalone_temp_dir, 'jasmine_standalone')
|
17
|
+
|
18
|
+
@version_dir = File.join(@standalone_staging_dir, "jasmine-standalone-#{jasmine_version}")
|
19
|
+
@lib_dir = File.join(@version_dir, 'lib')
|
20
|
+
@source_dir = File.join(@version_dir, 'src')
|
21
|
+
@spec_dir = File.join(@version_dir, 'spec')
|
22
|
+
|
23
|
+
@output = capture_output { jasmine_dev.build_standalone_distribution download_dir }
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should build the distribution" do
|
27
|
+
@output.should match(/Building Jasmine distribution/)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should tell the developer the task has started" do
|
31
|
+
@output.should match(/Building standalone distribution/)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should copy the lib directory to the staging directory, under a versioned directory" do
|
35
|
+
lib_dir_files = Dir.glob(File.join(standalone_temp_dir, 'jasmine_standalone', '**', '*'))
|
36
|
+
|
37
|
+
staged_lib_files = %w{ jasmine.js jasmine-html.js jasmine.css MIT.LICENSE }
|
38
|
+
staged_lib_files.each do |filename|
|
39
|
+
lib_dir_files.should include(File.join(@lib_dir, "jasmine-#{jasmine_version}", filename))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should copy the sample project source to the staging directory" do
|
44
|
+
File.exist?(File.join(@source_dir, 'Player.js')).should be_true
|
45
|
+
File.exist?(File.join(@source_dir, 'Song.js')).should be_true
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should copy the sample project specs to the staging directory" do
|
49
|
+
File.exist?(File.join(@spec_dir, 'PlayerSpec.js')).should be_true
|
50
|
+
File.exist?(File.join(@spec_dir, 'SpecHelper.js')).should be_true
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should copy a build SpecRunner.html to the staging directory" do
|
54
|
+
File.exist?(File.join(@version_dir, 'SpecRunner.html')).should be_true
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should zip up the contents of the staging directory" do
|
58
|
+
File.exist?(File.join(@standalone_staging_dir, "jasmine-standalone-#{jasmine_version}.zip")).should be_true
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should copy the zip file to the pages sub directory" do
|
62
|
+
File.exist?(File.join(download_dir, "jasmine-standalone-#{jasmine_version}.zip")).should be_true
|
63
|
+
end
|
64
|
+
|
65
|
+
describe "when the zip file is unzipped" do
|
66
|
+
before do
|
67
|
+
@out_directory = File.join(standalone_temp_dir, 'unzip')
|
68
|
+
reset_dir @out_directory
|
69
|
+
|
70
|
+
FileUtils.cp File.join(@standalone_staging_dir, "jasmine-standalone-#{jasmine_version}.zip"),
|
71
|
+
@out_directory
|
72
|
+
|
73
|
+
Dir.chdir @out_directory do
|
74
|
+
system("unzip -qq jasmine-standalone-#{jasmine_version}.zip")
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe "the distirbution" do
|
79
|
+
before do
|
80
|
+
Dir.chdir @out_directory do
|
81
|
+
@files = Dir.glob(File.join('**', '*'))
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should include the correct root files" do
|
86
|
+
@files.should include('SpecRunner.html')
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should include the correct lib files" do
|
90
|
+
%w{ jasmine.js jasmine-html.js jasmine.css MIT.LICENSE }.each do |file|
|
91
|
+
@files.should include(File.join('lib', "jasmine-#{jasmine_version}", file))
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should include the correct src files" do
|
96
|
+
%w{Player.js Song.js}.each do |file|
|
97
|
+
@files.should include(File.join('src', file))
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should include the correct spec files" do
|
102
|
+
%w{PlayerSpec.js SpecHelper.js}.each do |file|
|
103
|
+
@files.should include(File.join('spec', file))
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe "Build Standalone runner HTML task" do
|
4
|
+
|
5
|
+
let(:jasmine_dev) { JasmineDev.new }
|
6
|
+
let(:standalone_temp_dir) { "#{Dir.tmpdir}/jasmine_test" }
|
7
|
+
|
8
|
+
describe "build_standalone_runner" do
|
9
|
+
before do
|
10
|
+
reset_dir standalone_temp_dir
|
11
|
+
Dir.should_receive(:tmpdir).any_number_of_times.and_return(standalone_temp_dir)
|
12
|
+
|
13
|
+
@standalone_staging_dir = File.join(standalone_temp_dir, 'jasmine_standalone')
|
14
|
+
|
15
|
+
@version_dir = File.join(@standalone_staging_dir, "jasmine-standalone-#{jasmine_version}")
|
16
|
+
|
17
|
+
@output = capture_output { jasmine_dev.build_standalone_runner }
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should tell the developer the task has started" do
|
21
|
+
@output.should match(/Building standalone runner HTML/)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should copy a build SpecRunner.html to the staging directory" do
|
25
|
+
File.exist?(File.join(@version_dir, 'SpecRunner.html')).should be_true
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "should build the file that has HTML that" do
|
29
|
+
before do
|
30
|
+
html = File.read(File.join(@version_dir, 'SpecRunner.html'))
|
31
|
+
@runner = Nokogiri(html)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should have the favicon tag" do
|
35
|
+
favicon_tag = @runner.css('link')[0]
|
36
|
+
favicon_tag['href'].should match("lib/jasmine-#{jasmine_version}/jasmine_favicon.png")
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should have the stylesheet" do
|
40
|
+
css_tag = @runner.css('link')[1]
|
41
|
+
css_tag['href'].should match("lib/jasmine-#{jasmine_version}/jasmine.css")
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should have the jasmine script tags" do
|
45
|
+
script_sources = @runner.css('script').collect {|tag| tag['src']}
|
46
|
+
script_sources.should include("lib/jasmine-#{jasmine_version}/jasmine.js")
|
47
|
+
script_sources.should include("lib/jasmine-#{jasmine_version}/jasmine-html.js")
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should have the example source files" do
|
51
|
+
script_sources = @runner.css('script').collect {|tag| tag['src']}
|
52
|
+
script_sources.should include('src/Player.js')
|
53
|
+
script_sources.should include('src/Song.js')
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should have the example source files" do
|
57
|
+
script_sources = @runner.css('script').collect {|tag| tag['src']}
|
58
|
+
script_sources.should include('spec/SpecHelper.js')
|
59
|
+
script_sources.should include('spec/PlayerSpec.js')
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe "Spec counting task" do
|
4
|
+
|
5
|
+
let(:jasmine_dev) { JasmineDev.new }
|
6
|
+
|
7
|
+
before do
|
8
|
+
@output = capture_output { jasmine_dev.count_specs }
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should tell the developer that the specs are being counted" do
|
12
|
+
@output.should match(/Counting specs/)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should report the number of specs that will run in node" do
|
16
|
+
@output.should match(/\d+ \e\[0mspecs for Node.js/)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should report the number of specs that will run in the browser" do
|
20
|
+
@output.should match(/\d+ \e\[0mspecs for Browser/)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should remind the developer to check the count" do
|
24
|
+
@output.should match(/Please verify/)
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe "Spec tasks" do
|
4
|
+
|
5
|
+
let(:jasmine_dev) { JasmineDev.new }
|
6
|
+
|
7
|
+
describe "execute_specs_in_node" do
|
8
|
+
describe "when Node.js is not present" do
|
9
|
+
before do
|
10
|
+
jasmine_dev.should_receive(:has_node?).and_return(false)
|
11
|
+
@output = capture_output { jasmine_dev.execute_specs_in_node }
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should prompt the user to install Node" do
|
15
|
+
@output.should match(/Node\.js is required/)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "when Node.js is present" do
|
20
|
+
before do
|
21
|
+
jasmine_dev.should_receive(:has_node?).and_return(true)
|
22
|
+
@output = capture_output { jasmine_dev.execute_specs_in_node }
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should build the distribution" do
|
26
|
+
@output.should match(/Building Jasmine distribution/)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should tell the developer that the specs are being counted" do
|
30
|
+
@output.should match(/Counting specs/)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should tell the user that the specs are running in Node.js" do
|
34
|
+
@output.should match(/specs via Node/)
|
35
|
+
@output.should match(/Started/)
|
36
|
+
@output.should match(/\d+ specs, 0 failures/)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "execute_specs_in_browser" do
|
42
|
+
before do
|
43
|
+
jasmine_dev.should_receive(:run)
|
44
|
+
@output = capture_output { jasmine_dev.execute_specs_in_browser }
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should build the distribution" do
|
48
|
+
@output.should match(/Building Jasmine distribution/)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should tell the developer that the specs are being counted" do
|
52
|
+
@output.should match(/Counting specs/)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should tell the user that the specs are running in the broswer" do
|
56
|
+
@output.should match(/specs via the default web browser/)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "execute_specs" do
|
61
|
+
before do
|
62
|
+
@output = capture_output { jasmine_dev.execute_specs }
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should build the distribution" do
|
66
|
+
@output.should match(/Building Jasmine distribution/)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should tell the developer that the specs are being counted" do
|
70
|
+
@output.should match(/Counting specs/)
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should tell the user that the specs are running in Node.js" do
|
74
|
+
@output.should match(/specs via Node/)
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should tell the user that the specs are running in the broswer" do
|
78
|
+
@output.should match(/specs via the default web browser/)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|