jasmine-jstd-conf 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --colour
2
+ --profile
3
+ -fs
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.2-p180@jasmine-jstd-conf --create
data/README.rdoc CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
4
4
 
5
+ == Installation
6
+
7
+ Please see http://rubygems.org/gems/jasmine-jstd-conf
8
+
5
9
  == Tutorial
6
10
 
7
11
  Usage: jasmine-jstd-conf path [--help]
@@ -13,12 +17,12 @@ Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
13
17
 
14
18
  Example:
15
19
 
16
- $ bin/jasmine-jstd-conf jsTestDriver.conf
20
+ $ jasmine-jstd-conf jsTestDriver.conf
17
21
  $ cat jsTestDriver.conf
18
22
  server: http://localhost:9876
19
23
 
20
24
  load:
21
- - ../jasmine/lib/jasmine.js
25
+ - /path/to/jasmine.js
22
26
  - spec/javascripts/support/JasmineAdapter.js
23
27
  - spec/javascripts/helpers/jasmine-jquery-1.3.1.js
24
28
  - spec/javascripts/FooSpec.js
@@ -26,3 +30,13 @@ Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
26
30
  - spec/javascripts/BazSpec.js
27
31
  - spec/javascripts/QuxSpec.js
28
32
  # [...]
33
+
34
+ == Contributing
35
+
36
+ * Run <tt>./configure</tt> to set up your build environment
37
+ * Run +rake+ to run specs
38
+ * Please make a pull request with your changes.
39
+ * Please add specs for any new functionality.
40
+ * Similar to other gems, a console can be opened with:
41
+
42
+ irb -I lib -r jasmine-jstd-conf
data/Rakefile CHANGED
@@ -1 +1,7 @@
1
+ require 'rake'
2
+ require 'rspec/core/rake_task'
1
3
  require "bundler/gem_tasks"
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => :spec
@@ -18,10 +18,12 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
+ s.add_dependency('bundler') # For finding jasmine.js
21
22
  s.add_dependency('jasmine')
22
23
  s.add_dependency('mustache', '~> 0.99.4')
23
24
 
24
25
  s.add_development_dependency('bundler', '~> 1.0.0')
25
26
  s.add_development_dependency('rake', '~> 0.8.7')
27
+ s.add_development_dependency('rspec', '~> 2.8.0')
26
28
  s.add_development_dependency('yard', '< 1.0.0')
27
29
  end
@@ -1,7 +1,7 @@
1
1
  module Jasmine
2
2
  module JSTD
3
3
  module Conf
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -1,5 +1,6 @@
1
1
  require "jasmine-jstd-conf/version"
2
2
  require 'rubygems'
3
+ require 'bundler'
3
4
  require 'jasmine'
4
5
  require 'mustache'
5
6
 
@@ -17,18 +18,16 @@ load:
17
18
  EOF
18
19
 
19
20
  def self.map(doc)
20
- paths = [
21
- '../jasmine/lib/jasmine.js',
22
- 'spec/javascripts/support/JasmineAdapter.js',
23
- ]
21
+ paths = doc.js_files
24
22
 
25
- paths.concat(doc.js_files)
26
-
27
- paths.map! do |path|
23
+ paths = paths.map do |path|
28
24
  path.
29
25
  gsub(%r{^/}, '').
30
26
  gsub('__spec__', 'spec/javascripts')
31
27
  end
28
+
29
+ paths.unshift('spec/javascripts/support/JasmineAdapter.js')
30
+ paths.unshift(jasmine_js_path)
32
31
 
33
32
  {
34
33
  :server => 'http://localhost:9876',
@@ -60,7 +59,7 @@ Example:
60
59
  server: http://localhost:9876
61
60
 
62
61
  load:
63
- - ../jasmine/lib/jasmine.js
62
+ - /path/to/jasmine.js
64
63
  - spec/javascripts/support/JasmineAdapter.js
65
64
  - spec/javascripts/helpers/jasmine-jquery-1.3.1.js
66
65
  - spec/javascripts/FooSpec.js
@@ -71,6 +70,17 @@ Example:
71
70
  EOF
72
71
  exit -1
73
72
  end
73
+
74
+ private
75
+
76
+ def self.jasmine_js_path
77
+ "#{locate_gem}/lib/jasmine-core/jasmine.js"
78
+ end
79
+
80
+ def self.locate_gem
81
+ spec = Bundler.load.specs.find{|s| s.name == 'jasmine-core' }
82
+ spec.full_gem_path
83
+ end
74
84
  end
75
85
  end
76
86
  end
@@ -0,0 +1,36 @@
1
+ require 'spec_helper'
2
+
3
+ module Jasmine::JSTD
4
+ describe Conf do
5
+ before(:each) do
6
+ config = mock('Jasmine::Config', :js_files => [
7
+ '/__spec__/FooSpec.rb',
8
+ '/__spec__/BarSpec.rb',
9
+ ])
10
+ Jasmine::Config.stub(:new) { config }
11
+ end
12
+
13
+ describe 'the config file content' do
14
+ def render
15
+ Jasmine::JSTD::Conf.render
16
+ end
17
+
18
+ it 'includes the files specified in the Jasmine config' do
19
+ rendered = render
20
+
21
+ rendered.should match(%r{^ - spec/javascripts/FooSpec.rb$})
22
+ rendered.should match(%r{^ - spec/javascripts/BarSpec.rb$})
23
+ end
24
+
25
+ it 'includes jasmine.js from the jasmine-core gem' do
26
+ rendered = render
27
+
28
+ md = rendered.match(%r{^ - (/.*?/jasmine.js)$})
29
+ md.should_not be_nil
30
+ jasmine_js_path = md[1]
31
+
32
+ File.exists?(jasmine_js_path).should be_true
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'rspec'
3
+
4
+ require 'jasmine-jstd-conf'
5
+
6
+ RSpec.configure do |c|
7
+ c.mock_with :rspec
8
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jasmine-jstd-conf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Benjamin Oakes
@@ -10,11 +10,11 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-26 00:00:00 -05:00
13
+ date: 2012-01-27 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: jasmine
17
+ name: bundler
18
18
  prerelease: false
19
19
  requirement: &id001 !ruby/object:Gem::Requirement
20
20
  none: false
@@ -25,49 +25,71 @@ dependencies:
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency
28
- name: mustache
28
+ name: jasmine
29
29
  prerelease: false
30
30
  requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: mustache
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
31
42
  none: false
32
43
  requirements:
33
44
  - - ~>
34
45
  - !ruby/object:Gem::Version
35
46
  version: 0.99.4
36
47
  type: :runtime
37
- version_requirements: *id002
48
+ version_requirements: *id003
38
49
  - !ruby/object:Gem::Dependency
39
50
  name: bundler
40
51
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirement: &id004 !ruby/object:Gem::Requirement
42
53
  none: false
43
54
  requirements:
44
55
  - - ~>
45
56
  - !ruby/object:Gem::Version
46
57
  version: 1.0.0
47
58
  type: :development
48
- version_requirements: *id003
59
+ version_requirements: *id004
49
60
  - !ruby/object:Gem::Dependency
50
61
  name: rake
51
62
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
63
+ requirement: &id005 !ruby/object:Gem::Requirement
53
64
  none: false
54
65
  requirements:
55
66
  - - ~>
56
67
  - !ruby/object:Gem::Version
57
68
  version: 0.8.7
58
69
  type: :development
59
- version_requirements: *id004
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: rspec
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: 2.8.0
80
+ type: :development
81
+ version_requirements: *id006
60
82
  - !ruby/object:Gem::Dependency
61
83
  name: yard
62
84
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
85
+ requirement: &id007 !ruby/object:Gem::Requirement
64
86
  none: false
65
87
  requirements:
66
88
  - - <
67
89
  - !ruby/object:Gem::Version
68
90
  version: 1.0.0
69
91
  type: :development
70
- version_requirements: *id005
92
+ version_requirements: *id007
71
93
  description: Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
72
94
  email:
73
95
  - boakes@hedgeye.com
@@ -79,6 +101,8 @@ extra_rdoc_files: []
79
101
 
80
102
  files:
81
103
  - .gitignore
104
+ - .rspec
105
+ - .rvmrc
82
106
  - Gemfile
83
107
  - MIT-LICENSE
84
108
  - README.rdoc
@@ -88,6 +112,8 @@ files:
88
112
  - jasmine-jstd-conf.gemspec
89
113
  - lib/jasmine-jstd-conf.rb
90
114
  - lib/jasmine-jstd-conf/version.rb
115
+ - spec/lib/conf_spec.rb
116
+ - spec/spec_helper.rb
91
117
  has_rdoc: true
92
118
  homepage: ""
93
119
  licenses: []
@@ -116,5 +142,6 @@ rubygems_version: 1.5.2
116
142
  signing_key:
117
143
  specification_version: 3
118
144
  summary: Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
119
- test_files: []
120
-
145
+ test_files:
146
+ - spec/lib/conf_spec.rb
147
+ - spec/spec_helper.rb