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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d27fbdb45b2861ce8e64a2905bbea5dfd74b5bd2
4
- data.tar.gz: 89eae1fa8bb39a30c63f77f8593df5e7b8a500eb
2
+ SHA256:
3
+ metadata.gz: 579e33e011734d8de4ab41b4eadc63be3d63d0a5789e285d446e8f41cd4aefa7
4
+ data.tar.gz: 232f1e75fcd135d8dd961ae09fa08367809029f423b5c587f716a1161db37613
5
5
  SHA512:
6
- metadata.gz: 020b29befa987efeae9027e94ace463e4f499be858e0d75e2adba27e99f747caf173709357b9b3509071f0fabc5efe730aad3deaf629249b90feff59b27eb766
7
- data.tar.gz: 6b6bbd39fca2fb68443564075de964f8b2799ce4ed7836d2ead22fe075be3a2b5e80d838776bdec33d6d44bd134e5d6cf8973d8d8bb24ebf43967b784220482d
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.9/org/junit/rules/TemporaryFolder.html)
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://travis-ci.org/sue445/rspec-temp_dir.svg)](https://travis-ci.org/sue445/rspec-temp_dir)
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 1.9.3, 2.x
15
- * rspec 2.x, 3.0.0
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
- ### v0.0.2
74
- [full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.1...v0.0.2)
61
+ describe "within temp dir" do
62
+ # create temp dir and cd to temp dir
63
+ include_context "within temp dir"
75
64
 
76
- * bugfix: raise error when padrino and rspec3+
77
- * https://github.com/sue445/rspec-temp_dir/pull/1
78
-
79
- ### v0.0.1
80
- * first release
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
 
@@ -1,7 +1,8 @@
1
1
  require "tmpdir"
2
2
  require "rspec"
3
+ require "pathname"
3
4
 
4
- (RSpec.respond_to?(:shared_context) ? RSpec : Object).shared_context "uses temp dir" do
5
+ RSpec.shared_context "uses temp dir" do
5
6
  around do |example|
6
7
  Dir.mktmpdir("rspec-") do |dir|
7
8
  @temp_dir = dir
@@ -1,5 +1,5 @@
1
1
  module Rspec
2
2
  module TempDir
3
- VERSION = "0.0.3"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ require "rspec"
2
+
3
+ RSpec.shared_context "within temp dir" do
4
+ include_context "uses temp dir"
5
+
6
+ around do |example|
7
+ Dir.chdir(temp_dir) do
8
+ example.run
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,6 @@
1
1
  require "rspec/temp_dir/version"
2
2
  require "rspec/temp_dir/uses_temp_dir"
3
+ require "rspec/temp_dir/within_temp_dir"
3
4
 
4
5
  module Rspec
5
6
  module TempDir
@@ -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.add_dependency "rspec"
26
+ spec.required_ruby_version = ">= 2.0.0"
22
27
 
23
- spec.add_development_dependency "bundler", "~> 1.6"
24
- spec.add_development_dependency "rake"
28
+ spec.add_dependency "rspec", ">= 3.0"
25
29
 
26
- spec.add_development_dependency "codeclimate-test-reporter"
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
- require "codeclimate-test-reporter"
19
- CodeClimate::TestReporter.start
18
+ if ENV["CI"]
19
+ require "simplecov"
20
+ require "coveralls"
20
21
 
21
- require 'coveralls'
22
- Coveralls.wear!
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: 0.0.3
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: 2014-09-09 00:00:00.000000000 Z
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: '1.6'
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: '1.6'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
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: codeclimate-test-reporter
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: coveralls
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
- - ".travis.yml"
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
- post_install_message:
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: '0'
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
- rubyforge_project:
126
- rubygems_version: 2.2.2
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
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem 'rspec', "~> 2.14.1"
4
-
5
- gemspec path: '../'
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem 'rspec', "~> 3.0"
4
-
5
- gemspec path: '../'