testspace 0.1.3 → 0.1.4

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: 01ac217c3c3d8fe43ddfacf74d0676a4d26d4974
4
- data.tar.gz: 61c1508877f9095477ad657d5ee5436bd5522242
3
+ metadata.gz: c51e4136cd4023d3388623d55a1b95632ea9794f
4
+ data.tar.gz: b1ca8f35f8973ac8f63508719058efcb341e2165
5
5
  SHA512:
6
- metadata.gz: 87bb4d7c84a5e04a63c21ca63db2198ea67fb667bad04982d563342534c1e8eb5d97629e7aea44cfdcc87db50073d0da812d944d9131bcff2ef8a0b4574d3faf
7
- data.tar.gz: aa5dc08705ac6590e10e257829e9c5484bad9ba975f1e4cbd58f56cef4a480c908dfc1404e669858eb4364fe51fb2d23192c423a9bda0b707bc9923bc99623a4
6
+ metadata.gz: fcbc0a549df091aac62645b0b41ab633b797418487f7d48830d60366e73081b4379c61ec38221ee0a325e1229de6116ef4e0ba8c701dc74066ae4ae0bf62da85
7
+ data.tar.gz: d5c5b6f4574dea5e41c3a868eff3f5dab008f8b1556d4bb82089f677b232bbe4c2c47f541a90175e7683fafdd9f2172f9fb865926329f6cb3a092e2a296bbf14
@@ -1,4 +1,3 @@
1
- require "testspace/version"
2
1
  require 'quir'
3
2
  autoload :Mutex, 'mutex'
4
3
 
@@ -16,12 +16,21 @@ module Testspace::Rspec
16
16
  end
17
17
  end
18
18
 
19
+ def root?
20
+ !parent
21
+ end
22
+
19
23
  def root
20
- @root ||= parent ? parent.root : self
24
+ @root ||= root? ? self : parent.root
21
25
  end
22
26
 
23
27
  def dir
24
- @dir ||= parent ? "#{parent.dir}/#{local_dir}" : "#{root_dir}/#{local_dir}"
28
+ @dir ||= begin
29
+ a = []
30
+ a << (root? ? root_dir : parent.dir)
31
+ a << local_dir
32
+ a.compact.join('/')
33
+ end
25
34
  end
26
35
 
27
36
  def description_arg
@@ -0,0 +1,7 @@
1
+ module Testspace::Rspec::Metadata::Extensions::Description
2
+ module Anonymous
3
+ def local_dir
4
+ nil
5
+ end
6
+ end
7
+ end
@@ -1,9 +1,15 @@
1
1
  module Testspace::Rspec::Metadata::Extensions::Description
2
2
  module General
3
+ def root_dir
4
+ @root_dir ||= "#{::Dir.pwd}/spec/features"
5
+ end
6
+
3
7
  def local_dir
4
8
  @local_dir ||= begin
5
- s = description_arg.gsub(/\s+/, '_')
6
- '-' + s
9
+ s = description_arg
10
+ .gsub(/\s+/, '_')
11
+ .downcase
12
+ root.is_a?(General) ? s : '-' + s
7
13
  end
8
14
  end
9
15
  end
@@ -1,11 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'testspace/version'
5
-
6
1
  Gem::Specification.new do |spec|
7
2
  spec.name = "testspace"
8
- spec.version = Testspace::VERSION
3
+ spec.version = "0.1.4"
9
4
  spec.authors = ["mosop"]
10
5
  spec.email = ["mosop@a.b.com"]
11
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - mosop
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-23 00:00:00.000000000 Z
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: quir
@@ -101,13 +101,13 @@ files:
101
101
  - lib/testspace/modules.rb
102
102
  - lib/testspace/rspec/helpers.rb
103
103
  - lib/testspace/rspec/metadata.rb
104
+ - lib/testspace/rspec/metadata/extensions/description/anonymous.rb
104
105
  - lib/testspace/rspec/metadata/extensions/description/class_method.rb
105
106
  - lib/testspace/rspec/metadata/extensions/description/general.rb
106
107
  - lib/testspace/rspec/metadata/extensions/description/instance_method.rb
107
108
  - lib/testspace/rspec/metadata/extensions/description/module.rb
108
109
  - lib/testspace/space.rb
109
110
  - lib/testspace/testspaces.rb
110
- - lib/testspace/version.rb
111
111
  - testspace.gemspec
112
112
  homepage: https://github.com/mosop/testspace
113
113
  licenses: []
@@ -1,3 +0,0 @@
1
- module Testspace
2
- VERSION = "0.1.3"
3
- end