test_construct 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +4 -0
- data/lib/test_construct/rspec_integration.rb +28 -4
- data/lib/test_construct/version.rb +1 -1
- data/test/rspec_integration_test.rb +24 -0
- data/test_construct.gemspec +1 -2
- metadata +22 -48
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2226dcdf6b97f267ca95e2bf15fcc02cb68b9948
|
4
|
+
data.tar.gz: 40f781f1ad290caff5294dc87d08590f3785de97
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b3c46e63982e31c3f56e88b9908471397d04a7427aeeb30e8fed05810b03ee0a41c1f00c79e98425a5fbe3c5a72de121f2fcfee915062ff79d90120d9dc5af66
|
7
|
+
data.tar.gz: 4ef4c5a3a680b001e0dd29b73772538a6d2c1613ffcb4af0138d1bec0b67bd797535a9fb7415b23298adfff35d42c75b90b0d6f0e219e34d15aa7700fb5e3f35
|
data/CHANGELOG.md
CHANGED
@@ -36,18 +36,42 @@ RSpec.configure do |config|
|
|
36
36
|
config.include TestConstruct::Helpers
|
37
37
|
config.include TestConstruct::RSpecIntegration
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
version = RSpec::Version::STRING
|
40
|
+
major, minor, patch, rest = version.split(".")
|
41
|
+
major, minor, patch = [major, minor, patch].map(&:to_i)
|
42
|
+
|
43
|
+
def before_each(example)
|
44
|
+
return unless test_construct_enabled?(example)
|
41
45
|
options = test_construct_options(example)
|
42
46
|
example.metadata[:construct] = setup_construct(options)
|
43
47
|
end
|
44
48
|
|
45
|
-
|
46
|
-
|
49
|
+
def after_each(example)
|
50
|
+
return unless test_construct_enabled?(example)
|
47
51
|
options = test_construct_options(example)
|
48
52
|
teardown_construct(
|
49
53
|
example.metadata[:construct],
|
50
54
|
example.exception,
|
51
55
|
options)
|
52
56
|
end
|
57
|
+
|
58
|
+
if major == 2 && minor >= 7
|
59
|
+
config.before :each do
|
60
|
+
before_each(example)
|
61
|
+
end
|
62
|
+
|
63
|
+
config.after :each do
|
64
|
+
after_each(example)
|
65
|
+
end
|
66
|
+
elsif major == 3
|
67
|
+
config.before :each do |example|
|
68
|
+
before_each(example)
|
69
|
+
end
|
70
|
+
|
71
|
+
config.after :each do |example|
|
72
|
+
after_each(example)
|
73
|
+
end
|
74
|
+
else
|
75
|
+
raise "TestConstruct does not support RSpec #{version}"
|
76
|
+
end
|
53
77
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class RspecIntegrationTest < Minitest::Test
|
4
|
+
include TestConstruct::Helpers
|
5
|
+
|
6
|
+
test 'rspec integration' do
|
7
|
+
lib_path = File.realpath('lib')
|
8
|
+
within_construct do |construct|
|
9
|
+
spec_file_name = 'rspec_spec.rb'
|
10
|
+
construct.file(spec_file_name, <<-RSPEC)
|
11
|
+
require 'test_construct/rspec_integration'
|
12
|
+
|
13
|
+
describe 'test_construct', test_construct: true do
|
14
|
+
it 'accesses metadata' do |example|
|
15
|
+
f = example.metadata[:construct].file "somefile", "abcd"
|
16
|
+
expect(f.size).to eq 4
|
17
|
+
end
|
18
|
+
end
|
19
|
+
RSPEC
|
20
|
+
output = `rspec -I '#{lib_path}' #{spec_file_name}`
|
21
|
+
assert $CHILD_STATUS.success?, output
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/test_construct.gemspec
CHANGED
@@ -22,6 +22,5 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "minitest", "~> 5.0.8"
|
24
24
|
spec.add_development_dependency "mocha", "~> 0.14.0"
|
25
|
-
spec.add_development_dependency "
|
26
|
-
spec.add_development_dependency "rspec"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
26
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_construct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ben Brinckerhoff
|
@@ -10,104 +9,78 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2015-02-25 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: bundler
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- - ~>
|
18
|
+
- - "~>"
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '1.3'
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- - ~>
|
25
|
+
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '1.3'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rake
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - ">="
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - ">="
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: minitest
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- - ~>
|
46
|
+
- - "~>"
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: 5.0.8
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- - ~>
|
53
|
+
- - "~>"
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: 5.0.8
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: mocha
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
|
-
- - ~>
|
60
|
+
- - "~>"
|
69
61
|
- !ruby/object:Gem::Version
|
70
62
|
version: 0.14.0
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
|
-
- - ~>
|
67
|
+
- - "~>"
|
77
68
|
- !ruby/object:Gem::Version
|
78
69
|
version: 0.14.0
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
|
-
name: debugger
|
81
|
-
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
|
-
requirements:
|
84
|
-
- - ! '>='
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '0'
|
87
|
-
type: :development
|
88
|
-
prerelease: false
|
89
|
-
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
|
-
requirements:
|
92
|
-
- - ! '>='
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '0'
|
95
70
|
- !ruby/object:Gem::Dependency
|
96
71
|
name: rspec
|
97
72
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
73
|
requirements:
|
100
|
-
- -
|
74
|
+
- - "~>"
|
101
75
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
76
|
+
version: '3.0'
|
103
77
|
type: :development
|
104
78
|
prerelease: false
|
105
79
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
80
|
requirements:
|
108
|
-
- -
|
81
|
+
- - "~>"
|
109
82
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
83
|
+
version: '3.0'
|
111
84
|
description: Creates temporary files and directories for testing.
|
112
85
|
email:
|
113
86
|
- ben@bbrinck.com
|
@@ -116,7 +89,7 @@ executables: []
|
|
116
89
|
extensions: []
|
117
90
|
extra_rdoc_files: []
|
118
91
|
files:
|
119
|
-
- .gitignore
|
92
|
+
- ".gitignore"
|
120
93
|
- CHANGELOG.md
|
121
94
|
- Gemfile
|
122
95
|
- LICENSE.txt
|
@@ -129,34 +102,35 @@ files:
|
|
129
102
|
- lib/test_construct/pathname_extensions.rb
|
130
103
|
- lib/test_construct/rspec_integration.rb
|
131
104
|
- lib/test_construct/version.rb
|
105
|
+
- test/rspec_integration_test.rb
|
132
106
|
- test/test_construct_test.rb
|
133
107
|
- test/test_helper.rb
|
134
108
|
- test_construct.gemspec
|
135
109
|
homepage: ''
|
136
110
|
licenses:
|
137
111
|
- MIT
|
112
|
+
metadata: {}
|
138
113
|
post_install_message:
|
139
114
|
rdoc_options: []
|
140
115
|
require_paths:
|
141
116
|
- lib
|
142
117
|
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
-
none: false
|
144
118
|
requirements:
|
145
|
-
- -
|
119
|
+
- - ">="
|
146
120
|
- !ruby/object:Gem::Version
|
147
121
|
version: '0'
|
148
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
-
none: false
|
150
123
|
requirements:
|
151
|
-
- -
|
124
|
+
- - ">="
|
152
125
|
- !ruby/object:Gem::Version
|
153
126
|
version: '0'
|
154
127
|
requirements: []
|
155
128
|
rubyforge_project:
|
156
|
-
rubygems_version:
|
129
|
+
rubygems_version: 2.2.2
|
157
130
|
signing_key:
|
158
|
-
specification_version:
|
131
|
+
specification_version: 4
|
159
132
|
summary: Creates temporary files and directories for testing.
|
160
133
|
test_files:
|
134
|
+
- test/rspec_integration_test.rb
|
161
135
|
- test/test_construct_test.rb
|
162
136
|
- test/test_helper.rb
|