konacha 3.2.5 → 3.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29db494a3c1e072adcbe33e4332019c65dfb0501
4
- data.tar.gz: 4cb3c695c41ef7fa23fdc83597fd977b6e74f948
3
+ metadata.gz: 8156101061d59bd05a03b424d495add7840d937c
4
+ data.tar.gz: 42033b36a832484f6af799423b55fe31a8f947f0
5
5
  SHA512:
6
- metadata.gz: b9a9c8e52fd139ffa4b107072a9db3f910c66ff1e75b063908f5b338ff79df9693cac894b2723ec2c3e274e0da50de3d3b303cd9b48998171028fb9eadb79499
7
- data.tar.gz: 96621bc9d25f2f516dbbcdb707ebf939ea6b670b58491d3d37d074dbe20e1153de2e42256a363b2f8429719d8fb0282d374d064d4faf60723e2809099a21c285
6
+ metadata.gz: 56ed2a6bd7dbaff44fea2718f5d37cfd992f7333b485d5feba5a452bbd772ef1cca438f18c154432139b670105c478ee89e281ded1a113f09590b93dba07b649
7
+ data.tar.gz: 05c06314f71c147a416b8bb7009e74c6a949f4f7fc99eb8d23f101fd2968944e836e8843c42f624c4a13b19ff405365491889decd002daddd7d4dae9efd546cd
data/History.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # master
2
2
 
3
+ # 3.3.0
4
+
5
+ * Allow multiple spec_dir entries (#187)
6
+
3
7
  # 3.2.5
4
8
 
5
9
  * Better Rails 4.1 compatibility (#178)
@@ -17,7 +17,7 @@ the asset pipeline and engines.}
17
17
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  gem.name = "konacha"
19
19
  gem.require_paths = ["lib"]
20
- gem.version = "3.2.5"
20
+ gem.version = "3.3.0"
21
21
  gem.license = "MIT"
22
22
 
23
23
  gem.add_dependency "railties", ">= 3.1", "< 5"
@@ -32,17 +32,19 @@ module Konacha
32
32
  delegate :port, :spec_dir, :spec_matcher, :application, :driver, :runner_port, :formatters, :to => :config
33
33
 
34
34
  def spec_root
35
- File.join(Rails.root, config.spec_dir)
35
+ [config.spec_dir].flatten.map {|d| File.join(Rails.root, d)}
36
36
  end
37
37
 
38
38
  def spec_paths
39
- Rails.application.assets.each_entry(spec_root).find_all { |pathname|
40
- config.spec_matcher === pathname.basename.to_s &&
41
- (pathname.extname == '.js' || Tilt[pathname]) &&
42
- Rails.application.assets.content_type_of(pathname) == 'application/javascript'
43
- }.map { |pathname|
44
- pathname.to_s.gsub(File.join(spec_root, ''), '')
45
- }.sort
39
+ spec_root.flat_map do |root|
40
+ Rails.application.assets.each_entry(root).find_all { |pathname|
41
+ config.spec_matcher === pathname.basename.to_s &&
42
+ (pathname.extname == '.js' || Tilt[pathname]) &&
43
+ Rails.application.assets.content_type_of(pathname) == 'application/javascript'
44
+ }.map { |pathname|
45
+ pathname.to_s.gsub(File.join(root, ''), '')
46
+ }.sort
47
+ end
46
48
  end
47
49
  end
48
50
  end
@@ -44,7 +44,8 @@ module Konacha
44
44
  options.runner_port ||= nil
45
45
  options.formatters ||= self.class.formatters
46
46
 
47
- app.config.assets.paths << app.root.join(options.spec_dir).to_s
47
+ spec_dirs = [options.spec_dir].flatten
48
+ app.config.assets.paths += spec_dirs.map{|d| app.root.join(d).to_s}
48
49
  app.config.assets.raise_runtime_errors = false
49
50
  end
50
51
  end
@@ -0,0 +1,2 @@
1
+ window.MySection =
2
+ number_one: -> 1
@@ -0,0 +1,6 @@
1
+ #= require ./my_section
2
+
3
+ describe "MySection", ->
4
+ describe '#number_one', ->
5
+ it "returns 1", ->
6
+ MySection.number_one().should.equal 1
@@ -98,6 +98,31 @@ describe Konacha do
98
98
  subject.size.should == 1
99
99
  end
100
100
  end
101
+
102
+ context 'with additional spec directories' do
103
+ around do |example|
104
+ begin
105
+ spec_dir = Konacha.config.spec_dir
106
+ Konacha.configure {|c| c.spec_dir = ["spec/javascripts", "app/sections"]}
107
+ example.run
108
+ Rails.application.config.assets.paths << Rails.root.join("app/sections").to_s
109
+ ensure
110
+ Konacha.configure {|c| c.spec_dir = spec_dir}
111
+
112
+ end
113
+ end
114
+
115
+ it 'has specs from spec/javascripts' do
116
+ subject.should include("array_sum_js_spec.js")
117
+ subject.should include("array_sum_cs_spec.js.coffee")
118
+ end
119
+
120
+ it 'has specs from app/sections' do
121
+ Konacha.spec_root.should include Rails.root.join("app/sections").to_s
122
+ subject.should include("my_section/my_section_spec.js.coffee")
123
+ end
124
+ end
125
+
101
126
  end
102
127
 
103
128
  it "can be configured in an initializer" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konacha
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Firebaugh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-11 00:00:00.000000000 Z
11
+ date: 2014-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -254,6 +254,8 @@ files:
254
254
  - spec/controllers/specs_controller_spec.rb
255
255
  - spec/dummy/app/assets/javascripts/application.js
256
256
  - spec/dummy/app/assets/javascripts/array_sum.js.coffee
257
+ - spec/dummy/app/sections/my_section/my_section.js.coffee
258
+ - spec/dummy/app/sections/my_section/my_section_spec.js.coffee
257
259
  - spec/dummy/config.ru
258
260
  - spec/dummy/config/application.rb
259
261
  - spec/dummy/config/boot.rb
@@ -330,6 +332,8 @@ test_files:
330
332
  - spec/controllers/specs_controller_spec.rb
331
333
  - spec/dummy/app/assets/javascripts/application.js
332
334
  - spec/dummy/app/assets/javascripts/array_sum.js.coffee
335
+ - spec/dummy/app/sections/my_section/my_section.js.coffee
336
+ - spec/dummy/app/sections/my_section/my_section_spec.js.coffee
333
337
  - spec/dummy/config.ru
334
338
  - spec/dummy/config/application.rb
335
339
  - spec/dummy/config/boot.rb