jasmine-headless-webkit 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -123,7 +123,7 @@ module Jasmine
123
123
  data = @options[:config].dup
124
124
  [ [ 'src_files', 'src_dir' ], [ 'stylesheets', 'src_dir' ], [ 'helpers', 'spec_dir' ], [ 'spec_files', 'spec_dir' ] ].each do |searches, root|
125
125
  if data[searches]
126
- data[searches].collect do |search|
126
+ data[searches].flatten.collect do |search|
127
127
  path = search
128
128
  path = File.join(data[root], path) if data[root]
129
129
  found_files = Dir[path] - @files
@@ -8,6 +8,8 @@ module Jasmine
8
8
 
9
9
  class TestFailure < StandardError; end
10
10
  class ConsoleLogUsage < StandardError ; end
11
+
12
+ class JasmineConfigNotFound < Errno::ENOENT ; end
11
13
  end
12
14
  end
13
15
 
@@ -46,6 +46,8 @@ module Jasmine
46
46
  end
47
47
 
48
48
  def jasmine_config
49
+ raise JasmineConfigNotFound.new("Jasmine config not found. I tried #{@options[:jasmine_config]}.") if !File.file?(@options[:jasmine_config])
50
+
49
51
  @jasmine_config ||= JASMINE_DEFAULTS.dup.merge(YAML.load_file(@options[:jasmine_config]))
50
52
  end
51
53
 
@@ -28,7 +28,11 @@ module Jasmine
28
28
  <title>Jasmine Test Runner</title>
29
29
  <script type="text/javascript">
30
30
  window.console = { log: function(data) {
31
- JHW.log(JSON.stringify(data));
31
+ if (typeof(jQuery) !== 'undefined' && data instanceof jQuery) {
32
+ JHW.log($("<div />").append(data).html());
33
+ } else {
34
+ JHW.log(JSON.stringify(data));
35
+ }
32
36
  }, pp: function(data) {
33
37
  JHW.log(jasmine ? jasmine.pp(data) : JSON.stringify(data));
34
38
  } };
@@ -1,7 +1,7 @@
1
1
  module Jasmine
2
2
  module Headless
3
3
  module Webkit
4
- VERSION = "0.6.2"
4
+ VERSION = "0.6.3"
5
5
  end
6
6
  end
7
7
  end
data/lib/qt/qmake.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rbconfig'
2
+ require 'rubygems'
2
3
  require 'rubygems/version'
3
4
 
4
5
  module Qt
@@ -38,23 +38,42 @@ describe Jasmine::FilesList do
38
38
  end
39
39
  end
40
40
 
41
- let(:config) { {
42
- 'src_dir' => src_dir,
43
- 'spec_dir' => spec_dir,
44
- 'src_files' => [ 'js/first_file.js', 'js/*.js' ],
45
- 'spec_files' => [ '*_spec.js' ],
46
- 'helpers' => [ 'helper/*.js' ],
47
- 'stylesheets' => [ 'stylesheet/*.css' ]
48
- } }
41
+ shared_examples_for :reading_data do
42
+ it 'should read the data from the jasmine.yml file and add the files' do
43
+ files_list.files.should == Jasmine::FilesList::DEFAULT_FILES + [
44
+ File.expand_path(first_file),
45
+ File.expand_path(src_file),
46
+ File.expand_path(stylesheet_file),
47
+ File.expand_path(helper_file),
48
+ File.expand_path(spec_file)
49
+ ]
50
+ end
51
+ end
49
52
 
50
- it 'should read the data from the jasmine.yml file and add the files' do
51
- files_list.files.should == Jasmine::FilesList::DEFAULT_FILES + [
52
- File.expand_path(first_file),
53
- File.expand_path(src_file),
54
- File.expand_path(stylesheet_file),
55
- File.expand_path(helper_file),
56
- File.expand_path(spec_file)
57
- ]
53
+ context 'with normal list' do
54
+ let(:config) { {
55
+ 'src_dir' => src_dir,
56
+ 'spec_dir' => spec_dir,
57
+ 'src_files' => [ 'js/first_file.js', 'js/*.js' ],
58
+ 'spec_files' => [ '*_spec.js' ],
59
+ 'helpers' => [ 'helper/*.js' ],
60
+ 'stylesheets' => [ 'stylesheet/*.css' ]
61
+ } }
62
+
63
+ it_should_behave_like :reading_data
64
+ end
65
+
66
+ context 'with multidimensional list' do
67
+ let(:config) { {
68
+ 'src_dir' => src_dir,
69
+ 'spec_dir' => spec_dir,
70
+ 'src_files' => [ [ 'js/first_file.js', 'js/*.js' ] ],
71
+ 'spec_files' => [ '*_spec.js' ],
72
+ 'helpers' => [ 'helper/*.js' ],
73
+ 'stylesheets' => [ 'stylesheet/*.css' ]
74
+ } }
75
+
76
+ it_should_behave_like :reading_data
58
77
  end
59
78
  end
60
79
 
@@ -18,16 +18,29 @@ describe Jasmine::Headless::Runner do
18
18
  describe '#load_config' do
19
19
  include FakeFS::SpecHelpers
20
20
 
21
- let(:opts) { { :jasmine_config => 'test.yml' } }
22
-
23
21
  before do
24
- File.open(Jasmine::Headless::Runner::RUNNER, 'w')
25
- File.open('test.yml', 'w') { |fh| fh.print YAML.dump('test' => 'hello') }
22
+ File.open('ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner', 'w')
23
+ end
24
+
25
+ let(:config_filename) { 'test.yml' }
26
+ let(:opts) { { :jasmine_config => config_filename } }
27
+
28
+ context 'file exists' do
29
+ before do
30
+ File.open(Jasmine::Headless::Runner::RUNNER, 'w')
31
+ File.open(config_filename, 'w') { |fh| fh.print YAML.dump('test' => 'hello') }
32
+ end
33
+
34
+ it 'should load the jasmine config' do
35
+ runner.jasmine_config['test'].should == 'hello'
36
+ runner.jasmine_config['spec_dir'].should == 'spec/javascripts'
37
+ end
26
38
  end
27
39
 
28
- it 'should load the jasmine config' do
29
- runner.jasmine_config['test'].should == 'hello'
30
- runner.jasmine_config['spec_dir'].should == 'spec/javascripts'
40
+ context 'file does not exist' do
41
+ it 'should raise an exception' do
42
+ expect { runner.jasmine_config }.to raise_error(Jasmine::Headless::JasmineConfigNotFound, /#{config_filename}/)
43
+ end
31
44
  end
32
45
  end
33
46
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine-headless-webkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,12 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-08-10 00:00:00.000000000 -04:00
15
- default_executable:
14
+ date: 2011-08-12 00:00:00.000000000Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: jasmine-core
19
- requirement: &70920300 !ruby/object:Gem::Requirement
18
+ requirement: &72010180 !ruby/object:Gem::Requirement
20
19
  none: false
21
20
  requirements:
22
21
  - - ~>
@@ -24,10 +23,10 @@ dependencies:
24
23
  version: 1.1.beta
25
24
  type: :runtime
26
25
  prerelease: false
27
- version_requirements: *70920300
26
+ version_requirements: *72010180
28
27
  - !ruby/object:Gem::Dependency
29
28
  name: coffee-script
30
- requirement: &70920050 !ruby/object:Gem::Requirement
29
+ requirement: &72009930 !ruby/object:Gem::Requirement
31
30
  none: false
32
31
  requirements:
33
32
  - - ! '>='
@@ -35,10 +34,10 @@ dependencies:
35
34
  version: '2.2'
36
35
  type: :runtime
37
36
  prerelease: false
38
- version_requirements: *70920050
37
+ version_requirements: *72009930
39
38
  - !ruby/object:Gem::Dependency
40
39
  name: rainbow
41
- requirement: &70919860 !ruby/object:Gem::Requirement
40
+ requirement: &72009740 !ruby/object:Gem::Requirement
42
41
  none: false
43
42
  requirements:
44
43
  - - ! '>='
@@ -46,10 +45,10 @@ dependencies:
46
45
  version: '0'
47
46
  type: :runtime
48
47
  prerelease: false
49
- version_requirements: *70919860
48
+ version_requirements: *72009740
50
49
  - !ruby/object:Gem::Dependency
51
50
  name: multi_json
52
- requirement: &70919630 !ruby/object:Gem::Requirement
51
+ requirement: &72009510 !ruby/object:Gem::Requirement
53
52
  none: false
54
53
  requirements:
55
54
  - - ! '>='
@@ -57,7 +56,7 @@ dependencies:
57
56
  version: '0'
58
57
  type: :runtime
59
58
  prerelease: false
60
- version_requirements: *70919630
59
+ version_requirements: *72009510
61
60
  description: Run Jasmine specs headlessly
62
61
  email:
63
62
  - john@coswellproductions.com
@@ -149,7 +148,6 @@ files:
149
148
  - spec/lib/jasmine/template_writer_spec.rb
150
149
  - spec/lib/qt/qmake_spec.rb
151
150
  - spec/spec_helper.rb
152
- has_rdoc: true
153
151
  homepage: ''
154
152
  licenses: []
155
153
  post_install_message:
@@ -170,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
168
  version: '0'
171
169
  requirements: []
172
170
  rubyforge_project: jasmine-headless-webkit
173
- rubygems_version: 1.6.2
171
+ rubygems_version: 1.8.6
174
172
  signing_key:
175
173
  specification_version: 3
176
174
  summary: Run Jasmine specs headlessly in a WebKit browser