snapdragon 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -3
  3. data/.ruby-version +1 -1
  4. data/ChangeLog.markdown +7 -2
  5. data/lib/jasmine/MIT.LICENSE +20 -0
  6. data/lib/jasmine/boot.js +181 -0
  7. data/lib/jasmine/console.js +160 -0
  8. data/lib/jasmine/jasmine-html.js +359 -0
  9. data/lib/jasmine/jasmine.css +55 -0
  10. data/lib/jasmine/jasmine.js +2402 -0
  11. data/lib/jasmine/jasmine_favicon.png +0 -0
  12. data/lib/jasmine_v1/MIT.LICENSE +20 -0
  13. data/lib/{jasmine/lib/jasmine-core → jasmine_v1}/jasmine-html.js +0 -0
  14. data/lib/{jasmine/lib/jasmine-core → jasmine_v1}/jasmine.css +0 -0
  15. data/lib/{jasmine/lib/jasmine-core → jasmine_v1}/jasmine.js +0 -0
  16. data/lib/snapdragon/command_line_parser.rb +7 -3
  17. data/lib/snapdragon/resources/SnapdragonConsoleReporter.js +129 -128
  18. data/lib/snapdragon/resources/SnapdragonConsoleReporter_v1.js +162 -0
  19. data/lib/snapdragon/resources/SnapdragonJUnitReporter.js +142 -131
  20. data/lib/snapdragon/resources/SnapdragonJUnitReporter_v1.js +158 -0
  21. data/lib/snapdragon/suite.rb +4 -0
  22. data/lib/snapdragon/version.rb +1 -1
  23. data/lib/snapdragon/views/run.erb +21 -44
  24. data/lib/snapdragon/views/run_v1.erb +60 -0
  25. data/lib/snapdragon/web_application.rb +11 -3
  26. data/snapdragon.gemspec +7 -7
  27. data/spec/lib/snapdragon/cli_application_spec.rb +20 -19
  28. data/spec/lib/snapdragon/command_line_parser_spec.rb +44 -20
  29. data/spec/lib/snapdragon/path_spec.rb +21 -20
  30. data/spec/lib/snapdragon/spec_directory_spec.rb +2 -1
  31. data/spec/lib/snapdragon/spec_file_spec.rb +2 -1
  32. data/spec/lib/snapdragon/suite_spec.rb +54 -44
  33. data/spec/spec_helper.rb +7 -0
  34. metadata +51 -48
  35. data/lib/jasmine/lib/jasmine-core/example/SpecRunner.html +0 -54
  36. data/lib/jasmine/lib/jasmine-core/example/spec/PlayerSpec.js +0 -58
  37. data/lib/jasmine/lib/jasmine-core/example/spec/SpecHelper.js +0 -9
  38. data/lib/jasmine/lib/jasmine-core/example/src/Player.js +0 -22
  39. data/lib/jasmine/lib/jasmine-core/example/src/Song.js +0 -7
  40. data/lib/jasmine/lib/jasmine-core/json2.js +0 -478
  41. data/lib/jasmine/lib/jasmine-core/version.rb +0 -6
  42. data/lib/snapdragon/resources/.gitkeep +0 -0
@@ -1,10 +1,11 @@
1
+ require 'spec_helper'
1
2
  require_relative '../../../lib/snapdragon/spec_directory'
2
3
 
3
4
  describe Snapdragon::SpecDirectory do
4
5
  describe "#initialize" do
5
6
  it "assigns the given directory path" do
6
7
  spec_dir = Snapdragon::SpecDirectory.new('some/directory/path')
7
- spec_dir.instance_variable_get(:@path).should eq('some/directory/path')
8
+ expect(spec_dir.instance_variable_get(:@path)).to eq('some/directory/path')
8
9
  end
9
10
  end
10
11
 
@@ -1,10 +1,11 @@
1
+ require 'spec_helper'
1
2
  require_relative "../../../lib/snapdragon/spec_file"
2
3
 
3
4
  describe Snapdragon::SpecFile do
4
5
  describe "#initialize" do
5
6
  it "assigns the given path" do
6
7
  spec_file = Snapdragon::SpecFile.new('some/path/to_some_spec.js')
7
- spec_file.instance_variable_get(:@path).should eq('some/path/to_some_spec.js')
8
+ expect(spec_file.instance_variable_get(:@path)).to eq('some/path/to_some_spec.js')
8
9
  end
9
10
  end
10
11
 
@@ -1,103 +1,113 @@
1
+ require 'spec_helper'
1
2
  require_relative '../../../lib/snapdragon/suite'
2
3
 
3
4
  describe Snapdragon::Suite do
4
5
  describe "#initialize" do
5
6
  it "constucts an instance of a Suite given an array of paths" do
6
- options = stub
7
- paths = [stub, stub, stub]
7
+ options = double
8
+ paths = [double, double, double]
8
9
  Snapdragon::Suite.new(options, paths)
9
10
  end
10
11
 
11
12
  it "stores the paths in an instance variable" do
12
- options = stub
13
- paths = [stub, stub, stub]
13
+ options = double
14
+ paths = [double, double, double]
14
15
  suite = Snapdragon::Suite.new(options, paths)
15
- suite.instance_variable_get(:@paths).should eq(paths)
16
+ expect(suite.instance_variable_get(:@paths)).to eq(paths)
16
17
  end
17
18
 
18
19
  it 'stores the options in an instance variable' do
19
- options = stub
20
- paths = [stub, stub, stub]
20
+ options = double
21
+ paths = [double, double, double]
21
22
  suite = Snapdragon::Suite.new(options, paths)
22
- suite.instance_variable_get(:@options).should eq(options)
23
+ expect(suite.instance_variable_get(:@options)).to eq(options)
23
24
  end
24
25
  end
25
26
 
26
27
  describe "#formatter" do
27
28
  it "returns the configured formatter to use" do
28
- formatter = stub
29
- options = stub(format: formatter)
30
- suite = Snapdragon::Suite.new(options, stub)
31
- suite.formatter.should eq (formatter)
29
+ formatter = double
30
+ options = double(format: formatter)
31
+ suite = Snapdragon::Suite.new(options, double)
32
+ expect(suite.formatter).to be(formatter)
32
33
  end
33
34
  end
34
35
 
35
36
  describe "#use_color?" do
36
37
  it "returns the configured color setting" do
37
- color = stub
38
- options = stub(color: color)
39
- suite = Snapdragon::Suite.new(options, stub)
40
- suite.use_color?.should eq color
38
+ color = double
39
+ options = double(color: color)
40
+ suite = Snapdragon::Suite.new(options, double)
41
+ expect(suite.use_color?).to be(color)
41
42
  end
42
43
  end
43
44
 
44
45
  describe "#pattern" do
45
46
  it "returns the configured pattern setting" do
46
- pattern = stub
47
- options = stub(pattern: pattern)
48
- suite = Snapdragon::Suite.new(options, stub)
49
- suite.pattern.should eq pattern
47
+ pattern = double
48
+ options = double(pattern: pattern)
49
+ suite = Snapdragon::Suite.new(options, double)
50
+ expect(suite.pattern).to be(pattern)
50
51
  end
51
52
  end
52
-
53
+
54
+ describe "#jasmine_ver" do
55
+ it "returns the Jasmine version being used" do
56
+ jasmine_ver = double('Jasmine version')
57
+ options = double(jasmine_ver: jasmine_ver)
58
+ suite = Snapdragon::Suite.new(options, double)
59
+ expect(suite.jasmine_ver).to be(jasmine_ver)
60
+ end
61
+ end
62
+
53
63
  describe "#spec_files" do
54
64
  context "when paths are provided" do
55
65
  it "does not read pattern from options" do
56
- pattern = stub
57
- options = stub(pattern: pattern)
66
+ pattern = double
67
+ options = double(pattern: pattern)
58
68
  paths = ['path_a_str', 'path_b_str']
59
69
  suite = Snapdragon::Suite.new(options, paths)
60
- suite.should_not_receive(:pattern)
70
+ expect(suite).not_to receive(:pattern)
61
71
  suite.spec_files
62
72
  end
63
-
73
+
64
74
  it "creates a path object to represent the path" do
65
- options = stub
75
+ options = double
66
76
  paths = ['path_a_str', 'path_b_str']
67
77
  suite = Snapdragon::Suite.new(options, paths)
68
- Snapdragon::Path.should_receive(:new).with('path_a_str').and_return(stub(spec_files: []))
69
- Snapdragon::Path.should_receive(:new).with('path_b_str').and_return(stub(spec_files: []))
78
+ expect(Snapdragon::Path).to receive(:new).with('path_a_str').and_return(double(spec_files: []))
79
+ expect(Snapdragon::Path).to receive(:new).with('path_b_str').and_return(double(spec_files: []))
70
80
  suite.spec_files
71
81
  end
72
82
 
73
83
  it "returns the collection of the spec files of all of the paths" do
74
- options = stub
84
+ options = double
75
85
  paths = ['path_a_str', 'path_b_str']
76
86
  suite = Snapdragon::Suite.new(options, paths)
77
- spec_file_a = stub('spec_file_a'), spec_file_b = stub('spec_file_b')
78
- Snapdragon::Path.stub(:new).with('path_a_str').and_return(stub(spec_files: [spec_file_a]))
79
- Snapdragon::Path.stub(:new).with('path_b_str').and_return(stub(spec_files: [spec_file_b]))
80
- suite.spec_files.should eq([spec_file_a, spec_file_b])
87
+ spec_file_a = double('spec_file_a'), spec_file_b = double('spec_file_b')
88
+ allow(Snapdragon::Path).to receive(:new).with('path_a_str').and_return(double(spec_files: [spec_file_a]))
89
+ allow(Snapdragon::Path).to receive(:new).with('path_b_str').and_return(double(spec_files: [spec_file_b]))
90
+ expect(suite.spec_files).to eq([spec_file_a, spec_file_b])
81
91
  end
82
92
  end
83
-
93
+
84
94
  context "when paths are empty" do
85
95
  it "reads the pattern from the options" do
86
- pattern = stub
87
- options = stub(pattern: pattern)
96
+ pattern = double
97
+ options = double(pattern: pattern)
88
98
  suite = Snapdragon::Suite.new(options, [])
89
- suite.should_receive(:pattern).and_return(pattern)
99
+ expect(suite).to receive(:pattern).and_return(pattern)
90
100
  suite.spec_files
91
101
  end
92
-
102
+
93
103
  it "returns the collection of spec files matching the pattern" do
94
- pattern = stub
95
- options = stub(pattern: pattern)
96
- Dir.stub!(:[]) { ['path_c_str'] }
104
+ pattern = double
105
+ options = double(pattern: pattern)
106
+ allow(Dir).to receive(:[]).and_return(['path_c_str'])
97
107
  suite = Snapdragon::Suite.new(options, [])
98
- spec_file_c = stub('spec_file_c')
99
- Snapdragon::Path.stub(:new).with('path_c_str').and_return(stub(spec_files: [spec_file_c]))
100
- suite.spec_files.should eq([spec_file_c])
108
+ spec_file_c = double('spec_file_c')
109
+ allow(Snapdragon::Path).to receive(:new).with('path_c_str').and_return(double(spec_files: [spec_file_c]))
110
+ expect(suite.spec_files).to eq([spec_file_c])
101
111
  end
102
112
  end
103
113
  end
@@ -25,3 +25,10 @@ def hide_stdout(&block)
25
25
  $stdout = original_stdout
26
26
  end
27
27
  end
28
+
29
+ # Disable "should" syntax.
30
+ RSpec.configure do |config|
31
+ config.expect_with :rspec do |c|
32
+ c.syntax = :expect
33
+ end
34
+ end
metadata CHANGED
@@ -1,113 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapdragon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-13 00:00:00.000000000 Z
11
+ date: 2014-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.0
19
+ version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.0
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: poltergeist
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.3.0
33
+ version: '1.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.3.0
40
+ version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sinatra
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.4.3
47
+ version: '1.4'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.4.3
54
+ version: '1.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: launchy
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.3.0
61
+ version: '2.4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.3.0
68
+ version: '2.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.3'
75
+ version: '1.5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.3'
82
+ version: '1.5'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '10.1'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '10.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 2.13.0
103
+ version: '2.14'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 2.13.0
110
+ version: '2.14'
111
111
  description: A Jasmine JavaScript test runner that lets you run tests on the command-line
112
112
  similar to RSpec.
113
113
  email:
@@ -118,10 +118,10 @@ executables:
118
118
  extensions: []
119
119
  extra_rdoc_files: []
120
120
  files:
121
- - .gitignore
122
- - .gitmodules
123
- - .ruby-gemset
124
- - .ruby-version
121
+ - ".gitignore"
122
+ - ".gitmodules"
123
+ - ".ruby-gemset"
124
+ - ".ruby-version"
125
125
  - ChangeLog.markdown
126
126
  - Gemfile
127
127
  - LICENSE.txt
@@ -134,20 +134,33 @@ files:
134
134
  - example/spec_helper.js
135
135
  - example/src/hoopty.js
136
136
  - example/src/jack.js
137
+ - lib/jasmine/MIT.LICENSE
138
+ - lib/jasmine/boot.js
139
+ - lib/jasmine/console.js
140
+ - lib/jasmine/jasmine-html.js
141
+ - lib/jasmine/jasmine.css
142
+ - lib/jasmine/jasmine.js
143
+ - lib/jasmine/jasmine_favicon.png
144
+ - lib/jasmine_v1/MIT.LICENSE
145
+ - lib/jasmine_v1/jasmine-html.js
146
+ - lib/jasmine_v1/jasmine.css
147
+ - lib/jasmine_v1/jasmine.js
137
148
  - lib/snapdragon.rb
138
149
  - lib/snapdragon/cli_application.rb
139
150
  - lib/snapdragon/command_line_parser.rb
140
151
  - lib/snapdragon/file_base.rb
141
152
  - lib/snapdragon/path.rb
142
- - lib/snapdragon/resources/.gitkeep
143
153
  - lib/snapdragon/resources/SnapdragonConsoleReporter.js
154
+ - lib/snapdragon/resources/SnapdragonConsoleReporter_v1.js
144
155
  - lib/snapdragon/resources/SnapdragonJUnitReporter.js
156
+ - lib/snapdragon/resources/SnapdragonJUnitReporter_v1.js
145
157
  - lib/snapdragon/spec_directory.rb
146
158
  - lib/snapdragon/spec_file.rb
147
159
  - lib/snapdragon/suite.rb
148
160
  - lib/snapdragon/version.rb
149
161
  - lib/snapdragon/views/layout.erb
150
162
  - lib/snapdragon/views/run.erb
163
+ - lib/snapdragon/views/run_v1.erb
151
164
  - lib/snapdragon/web_application.rb
152
165
  - snapdragon.gemspec
153
166
  - spec/lib/snapdragon/cli_application_spec.rb
@@ -157,16 +170,6 @@ files:
157
170
  - spec/lib/snapdragon/spec_file_spec.rb
158
171
  - spec/lib/snapdragon/suite_spec.rb
159
172
  - spec/spec_helper.rb
160
- - lib/jasmine/lib/jasmine-core/example/spec/PlayerSpec.js
161
- - lib/jasmine/lib/jasmine-core/example/spec/SpecHelper.js
162
- - lib/jasmine/lib/jasmine-core/example/SpecRunner.html
163
- - lib/jasmine/lib/jasmine-core/example/src/Player.js
164
- - lib/jasmine/lib/jasmine-core/example/src/Song.js
165
- - lib/jasmine/lib/jasmine-core/jasmine-html.js
166
- - lib/jasmine/lib/jasmine-core/jasmine.css
167
- - lib/jasmine/lib/jasmine-core/jasmine.js
168
- - lib/jasmine/lib/jasmine-core/json2.js
169
- - lib/jasmine/lib/jasmine-core/version.rb
170
173
  homepage: http://github.com/reachlocal/snapdragon
171
174
  licenses:
172
175
  - MIT
@@ -177,17 +180,17 @@ require_paths:
177
180
  - lib
178
181
  required_ruby_version: !ruby/object:Gem::Requirement
179
182
  requirements:
180
- - - '>='
183
+ - - ">="
181
184
  - !ruby/object:Gem::Version
182
185
  version: '0'
183
186
  required_rubygems_version: !ruby/object:Gem::Requirement
184
187
  requirements:
185
- - - '>='
188
+ - - ">="
186
189
  - !ruby/object:Gem::Version
187
190
  version: '0'
188
191
  requirements: []
189
192
  rubyforge_project:
190
- rubygems_version: 2.0.5
193
+ rubygems_version: 2.2.0
191
194
  signing_key:
192
195
  specification_version: 4
193
196
  summary: A command-line Jasmine JavaScript test runner.
@@ -1,54 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
- "http://www.w3.org/TR/html4/loose.dtd">
3
- <html>
4
- <head>
5
- <title>Jasmine Spec Runner</title>
6
-
7
- <link rel="shortcut icon" type="image/png" href="lib/jasmine-1.1.0.rc1/jasmine_favicon.png">
8
-
9
- <link rel="stylesheet" type="text/css" href="lib/jasmine-1.1.0.rc1/jasmine.css">
10
- <script type="text/javascript" src="lib/jasmine-1.1.0.rc1/jasmine.js"></script>
11
- <script type="text/javascript" src="lib/jasmine-1.1.0.rc1/jasmine-html.js"></script>
12
-
13
- <!-- include spec files here... -->
14
- <script type="text/javascript" src="spec/SpecHelper.js"></script>
15
- <script type="text/javascript" src="spec/PlayerSpec.js"></script>
16
-
17
- <!-- include source files here... -->
18
- <script type="text/javascript" src="src/Player.js"></script>
19
- <script type="text/javascript" src="src/Song.js"></script>
20
-
21
- <script type="text/javascript">
22
- (function() {
23
- var jasmineEnv = jasmine.getEnv();
24
- jasmineEnv.updateInterval = 1000;
25
-
26
- var trivialReporter = new jasmine.TrivialReporter();
27
-
28
- jasmineEnv.addReporter(trivialReporter);
29
-
30
- jasmineEnv.specFilter = function(spec) {
31
- return trivialReporter.specFilter(spec);
32
- };
33
-
34
- var currentWindowOnload = window.onload;
35
-
36
- window.onload = function() {
37
- if (currentWindowOnload) {
38
- currentWindowOnload();
39
- }
40
- execJasmine();
41
- };
42
-
43
- function execJasmine() {
44
- jasmineEnv.execute();
45
- }
46
-
47
- })();
48
- </script>
49
-
50
- </head>
51
-
52
- <body>
53
- </body>
54
- </html>