rspec-temp_dir 0.0.3 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +113 -0
- data/CHANGELOG.md +44 -0
- data/Gemfile +20 -0
- data/README.md +12 -23
- data/lib/rspec/temp_dir/uses_temp_dir.rb +2 -1
- data/lib/rspec/temp_dir/version.rb +1 -1
- data/lib/rspec/temp_dir/within_temp_dir.rb +11 -0
- data/lib/rspec/temp_dir.rb +1 -0
- data/rspec-temp_dir.gemspec +10 -4
- data/spec/rspec/within_temp_dir_spec.rb +21 -0
- data/spec/spec_helper.rb +6 -4
- metadata +26 -21
- data/.travis.yml +0 -15
- data/gemfiles/rspec2.gemfile +0 -5
- data/gemfiles/rspec3.gemfile +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 579e33e011734d8de4ab41b4eadc63be3d63d0a5789e285d446e8f41cd4aefa7
|
4
|
+
data.tar.gz: 232f1e75fcd135d8dd961ae09fa08367809029f423b5c587f716a1161db37613
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26d3503fcee5866f7983007d8e10e543024f91aafc680eaabb54e1a3517c97cf3c450021b84292a31c6a266bdc4991d981c77f8c0b11b3fdbb386eab6ba1df8a
|
7
|
+
data.tar.gz: 8d54bcd20cd7019a84d21740ad0b1b3c51592144d323750664815d075827762e1b17b59606fae804d73b404a5f07959fc5e27c5927002d0250a6a315bdd6c75f
|
@@ -0,0 +1,113 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
types:
|
9
|
+
- opened
|
10
|
+
- synchronize
|
11
|
+
- reopened
|
12
|
+
schedule:
|
13
|
+
- cron: "0 10 * * 5" # JST 19:00 (Fri)
|
14
|
+
|
15
|
+
env:
|
16
|
+
CI: "true"
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
test:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
|
22
|
+
container: ${{ matrix.ruby }}
|
23
|
+
|
24
|
+
strategy:
|
25
|
+
fail-fast: false
|
26
|
+
|
27
|
+
matrix:
|
28
|
+
ruby:
|
29
|
+
- ruby:2.0
|
30
|
+
- ruby:2.1
|
31
|
+
- ruby:2.2
|
32
|
+
- ruby:2.3
|
33
|
+
- ruby:2.4
|
34
|
+
- ruby:2.5
|
35
|
+
- ruby:2.6
|
36
|
+
- ruby:2.7
|
37
|
+
- ruby:3.0
|
38
|
+
- rubylang/ruby:master-nightly-bionic
|
39
|
+
include:
|
40
|
+
- ruby: rubylang/ruby:master-nightly-bionic
|
41
|
+
allow_failures: "true"
|
42
|
+
|
43
|
+
steps:
|
44
|
+
- uses: actions/checkout@v2
|
45
|
+
|
46
|
+
|
47
|
+
- name: Cache vendor/bundle
|
48
|
+
uses: actions/cache@v1
|
49
|
+
id: cache_gem
|
50
|
+
with:
|
51
|
+
path: vendor/bundle
|
52
|
+
key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
|
53
|
+
restore-keys: |
|
54
|
+
v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
|
55
|
+
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
56
|
+
|
57
|
+
- name: bundle update
|
58
|
+
run: |
|
59
|
+
set -xe
|
60
|
+
bundle config path vendor/bundle
|
61
|
+
bundle update --jobs $(nproc) --retry 3
|
62
|
+
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
63
|
+
|
64
|
+
- name: Setup Code Climate Test Reporter
|
65
|
+
uses: aktions/codeclimate-test-reporter@v1
|
66
|
+
with:
|
67
|
+
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
68
|
+
command: before-build
|
69
|
+
if: matrix.ruby >= 'ruby:2.4'
|
70
|
+
continue-on-error: true
|
71
|
+
|
72
|
+
- name: Run test
|
73
|
+
run: |
|
74
|
+
set -xe
|
75
|
+
bundle exec rspec
|
76
|
+
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
77
|
+
|
78
|
+
- name: Teardown Code Climate Test Reporter
|
79
|
+
uses: aktions/codeclimate-test-reporter@v1
|
80
|
+
with:
|
81
|
+
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
82
|
+
command: after-build
|
83
|
+
if: matrix.ruby >= 'ruby:2.4' && always()
|
84
|
+
continue-on-error: true
|
85
|
+
|
86
|
+
- name: Slack Notification (not success)
|
87
|
+
uses: lazy-actions/slatify@master
|
88
|
+
if: "! success()"
|
89
|
+
continue-on-error: true
|
90
|
+
with:
|
91
|
+
job_name: ${{ format('*build* ({0})', matrix.ruby) }}
|
92
|
+
type: ${{ job.status }}
|
93
|
+
icon_emoji: ":octocat:"
|
94
|
+
url: ${{ secrets.SLACK_WEBHOOK }}
|
95
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
96
|
+
|
97
|
+
notify:
|
98
|
+
needs:
|
99
|
+
- test
|
100
|
+
|
101
|
+
runs-on: ubuntu-latest
|
102
|
+
|
103
|
+
steps:
|
104
|
+
- name: Slack Notification (success)
|
105
|
+
uses: lazy-actions/slatify@master
|
106
|
+
if: always()
|
107
|
+
continue-on-error: true
|
108
|
+
with:
|
109
|
+
job_name: '*build*'
|
110
|
+
type: ${{ job.status }}
|
111
|
+
icon_emoji: ":octocat:"
|
112
|
+
url: ${{ secrets.SLACK_WEBHOOK }}
|
113
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Changelog
|
2
|
+
## master
|
3
|
+
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v1.1.1...master)
|
4
|
+
|
5
|
+
## v1.1.1
|
6
|
+
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v1.1.0...v1.1.1)
|
7
|
+
|
8
|
+
* Enable MFA requirement for gem releasing
|
9
|
+
* https://github.com/sue445/rspec-temp_dir/pull/35
|
10
|
+
|
11
|
+
## v1.1.0
|
12
|
+
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v1.0.0...v1.1.0)
|
13
|
+
|
14
|
+
* Impl within temp dir
|
15
|
+
* https://github.com/sue445/rspec-temp_dir/pull/13
|
16
|
+
|
17
|
+
## v1.0.0
|
18
|
+
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.4...v1.0.0)
|
19
|
+
|
20
|
+
* Drop support ruby 1.9
|
21
|
+
* https://github.com/sue445/rspec-temp_dir/pull/10
|
22
|
+
* Drop support rspec 2.x
|
23
|
+
* https://github.com/sue445/rspec-temp_dir/pull/9
|
24
|
+
|
25
|
+
## v0.0.4
|
26
|
+
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.3...v0.0.4)
|
27
|
+
|
28
|
+
* Fixed no method error for Pathname ruby 2.2.2
|
29
|
+
* https://github.com/sue445/rspec-temp_dir/pull/5
|
30
|
+
|
31
|
+
## v0.0.3
|
32
|
+
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.2...v0.0.3)
|
33
|
+
|
34
|
+
* support `temp_dir_path`
|
35
|
+
* https://github.com/sue445/rspec-temp_dir/pull/2
|
36
|
+
|
37
|
+
## v0.0.2
|
38
|
+
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.1...v0.0.2)
|
39
|
+
|
40
|
+
* bugfix: raise error when padrino and rspec3+
|
41
|
+
* https://github.com/sue445/rspec-temp_dir/pull/1
|
42
|
+
|
43
|
+
## v0.0.1
|
44
|
+
* first release
|
data/Gemfile
CHANGED
@@ -2,3 +2,23 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in rspec-temp_dir.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.0")
|
7
|
+
# NOTE: rake v13.0.0+ requires Ruby 2.2.0+
|
8
|
+
gem "rake", "< 13.0.0"
|
9
|
+
end
|
10
|
+
|
11
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.3.0")
|
12
|
+
# NOTE: json 2.6.0+ requires Ruby 2.3.0+
|
13
|
+
gem "json", "< 2.6.0"
|
14
|
+
end
|
15
|
+
|
16
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.4.0")
|
17
|
+
# NOTE: simplecov-html v0.11.0+ requires Ruby ~> 2.4
|
18
|
+
gem "simplecov-html", "< 0.11.0"
|
19
|
+
end
|
20
|
+
|
21
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.5.0")
|
22
|
+
# NOTE: docile v1.4.0+ requires Ruby 2.5.0+
|
23
|
+
gem "docile", "< 1.4.0"
|
24
|
+
end
|
data/README.md
CHANGED
@@ -2,17 +2,16 @@
|
|
2
2
|
|
3
3
|
create automatically temporary directory at each examples
|
4
4
|
|
5
|
-
This is inspired by Junit [TemporaryFolder](http://junit.org/javadoc/4.
|
5
|
+
This is inspired by Junit [TemporaryFolder](http://junit.org/junit4/javadoc/4.12/org/junit/rules/TemporaryFolder.html)
|
6
6
|
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/rspec-temp_dir.svg)](http://badge.fury.io/rb/rspec-temp_dir)
|
8
|
-
[![Build Status](https://
|
8
|
+
[![Build Status](https://github.com/sue445/rspec-temp_dir/workflows/test/badge.svg?branch=master)](https://github.com/sue445/rspec-temp_dir/actions?query=workflow%3Atest)
|
9
9
|
[![Code Climate](https://codeclimate.com/github/sue445/rspec-temp_dir.png)](https://codeclimate.com/github/sue445/rspec-temp_dir)
|
10
10
|
[![Coverage Status](https://img.shields.io/coveralls/sue445/rspec-temp_dir.svg)](https://coveralls.io/r/sue445/rspec-temp_dir)
|
11
|
-
[![Dependency Status](https://gemnasium.com/sue445/rspec-temp_dir.svg)](https://gemnasium.com/sue445/rspec-temp_dir)
|
12
11
|
|
13
12
|
## Requirements
|
14
|
-
* ruby
|
15
|
-
* rspec
|
13
|
+
* ruby 2.0+
|
14
|
+
* rspec 3.0.0+
|
16
15
|
|
17
16
|
## Installation
|
18
17
|
|
@@ -58,26 +57,16 @@ describe "uses temp dir" do
|
|
58
57
|
it { should be_exist }
|
59
58
|
end
|
60
59
|
end
|
61
|
-
```
|
62
|
-
|
63
|
-
## Changelog
|
64
|
-
### master
|
65
|
-
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.3...master)
|
66
|
-
|
67
|
-
### v0.0.3
|
68
|
-
[full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.2...v0.0.3)
|
69
|
-
|
70
|
-
* support `temp_dir_path`
|
71
|
-
* https://github.com/sue445/rspec-temp_dir/pull/2g
|
72
60
|
|
73
|
-
|
74
|
-
|
61
|
+
describe "within temp dir" do
|
62
|
+
# create temp dir and cd to temp dir
|
63
|
+
include_context "within temp dir"
|
75
64
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
65
|
+
it "within temp dir" do
|
66
|
+
expect(Dir.pwd).to eq temp_dir
|
67
|
+
end
|
68
|
+
end
|
69
|
+
```
|
81
70
|
|
82
71
|
## Contributing
|
83
72
|
|
data/lib/rspec/temp_dir.rb
CHANGED
data/rspec-temp_dir.gemspec
CHANGED
@@ -13,16 +13,22 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://github.com/sue445/rspec-temp_dir"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
18
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
19
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
20
|
+
|
16
21
|
spec.files = `git ls-files -z`.split("\x0")
|
17
22
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
23
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
24
|
spec.require_paths = ["lib"]
|
20
25
|
|
21
|
-
spec.
|
26
|
+
spec.required_ruby_version = ">= 2.0.0"
|
22
27
|
|
23
|
-
spec.
|
24
|
-
spec.add_development_dependency "rake"
|
28
|
+
spec.add_dependency "rspec", ">= 3.0"
|
25
29
|
|
26
|
-
spec.add_development_dependency "
|
30
|
+
spec.add_development_dependency "bundler"
|
27
31
|
spec.add_development_dependency "coveralls"
|
32
|
+
spec.add_development_dependency "rake"
|
33
|
+
spec.add_development_dependency "simplecov"
|
28
34
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "rbconfig"
|
2
|
+
|
3
|
+
describe "within temp dir" do
|
4
|
+
include_context "within temp dir"
|
5
|
+
|
6
|
+
it "within temp dir" do
|
7
|
+
expect(current_dir).to eq temp_dir
|
8
|
+
end
|
9
|
+
|
10
|
+
def current_dir
|
11
|
+
dir = Dir.pwd
|
12
|
+
|
13
|
+
case RbConfig::CONFIG["host_os"]
|
14
|
+
when /darwin|mac os/
|
15
|
+
# FIXME: `Dir.mktmpdir` returns "/var/folders/xxx", but `pwd` returns "/private/var/folders/xxx" ...
|
16
|
+
dir.gsub!(%r{^/private/}, "/")
|
17
|
+
end
|
18
|
+
|
19
|
+
dir
|
20
|
+
end
|
21
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -15,11 +15,13 @@
|
|
15
15
|
#
|
16
16
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
if ENV["CI"]
|
19
|
+
require "simplecov"
|
20
|
+
require "coveralls"
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
23
|
+
SimpleCov.start
|
24
|
+
end
|
23
25
|
|
24
26
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
25
27
|
require 'rspec/temp_dir'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-temp_dir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -16,30 +16,30 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: coveralls
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -88,26 +88,31 @@ extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
90
|
- ".coveralls.yml"
|
91
|
+
- ".github/workflows/test.yml"
|
91
92
|
- ".gitignore"
|
92
93
|
- ".rspec"
|
93
|
-
-
|
94
|
+
- CHANGELOG.md
|
94
95
|
- Gemfile
|
95
96
|
- LICENSE.txt
|
96
97
|
- README.md
|
97
98
|
- Rakefile
|
98
|
-
- gemfiles/rspec2.gemfile
|
99
|
-
- gemfiles/rspec3.gemfile
|
100
99
|
- lib/rspec/temp_dir.rb
|
101
100
|
- lib/rspec/temp_dir/uses_temp_dir.rb
|
102
101
|
- lib/rspec/temp_dir/version.rb
|
102
|
+
- lib/rspec/temp_dir/within_temp_dir.rb
|
103
103
|
- rspec-temp_dir.gemspec
|
104
104
|
- spec/rspec/uses_temp_dir_spec.rb
|
105
|
+
- spec/rspec/within_temp_dir_spec.rb
|
105
106
|
- spec/spec_helper.rb
|
106
107
|
homepage: https://github.com/sue445/rspec-temp_dir
|
107
108
|
licenses:
|
108
109
|
- MIT
|
109
|
-
metadata:
|
110
|
-
|
110
|
+
metadata:
|
111
|
+
homepage_uri: https://github.com/sue445/rspec-temp_dir
|
112
|
+
source_code_uri: https://github.com/sue445/rspec-temp_dir
|
113
|
+
changelog_uri: https://github.com/sue445/rspec-temp_dir/blob/master/CHANGELOG.md
|
114
|
+
rubygems_mfa_required: 'true'
|
115
|
+
post_install_message:
|
111
116
|
rdoc_options: []
|
112
117
|
require_paths:
|
113
118
|
- lib
|
@@ -115,18 +120,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
120
|
requirements:
|
116
121
|
- - ">="
|
117
122
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
123
|
+
version: 2.0.0
|
119
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
125
|
requirements:
|
121
126
|
- - ">="
|
122
127
|
- !ruby/object:Gem::Version
|
123
128
|
version: '0'
|
124
129
|
requirements: []
|
125
|
-
|
126
|
-
|
127
|
-
signing_key:
|
130
|
+
rubygems_version: 3.2.22
|
131
|
+
signing_key:
|
128
132
|
specification_version: 4
|
129
133
|
summary: create automatically temporary directory at each examples
|
130
134
|
test_files:
|
131
135
|
- spec/rspec/uses_temp_dir_spec.rb
|
136
|
+
- spec/rspec/within_temp_dir_spec.rb
|
132
137
|
- spec/spec_helper.rb
|
data/.travis.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.9.3
|
4
|
-
- 2.0.0
|
5
|
-
- 2.1.2
|
6
|
-
gemfile:
|
7
|
-
- gemfiles/rspec2.gemfile
|
8
|
-
- gemfiles/rspec3.gemfile
|
9
|
-
bundler_args: --jobs=2
|
10
|
-
script: CODECLIMATE_REPO_TOKEN=329887587f83c7ce5a1ab75f426c00830ba5ffac290c90bc486713c88baea900 bundle exec rspec
|
11
|
-
branches:
|
12
|
-
only:
|
13
|
-
- master
|
14
|
-
notifications:
|
15
|
-
email: false
|
data/gemfiles/rspec2.gemfile
DELETED