rspec-temp_dir 1.0.0 → 1.1.0

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: 35c477baeaf39f18b3c5a5bb9e719053425b6a98
4
- data.tar.gz: 10d39374664715b15e5201710c8de0f7afc87e53
2
+ SHA256:
3
+ metadata.gz: 8672e2bef3db72eafc191d56a8fb001aa21835e58d6c87c735ae2844e3a0a8ef
4
+ data.tar.gz: d068969084129500ba2184b89a984b39dcadee4e26828c80a619bde995334881
5
5
  SHA512:
6
- metadata.gz: 3a9c6076d9479b98abe924a6a6c9de9a92ccdd09cddcd298e3c502baebad80bd76ef7d1898abe531fab490bd09eb0df28203546798251e34d76aec8c315968c3
7
- data.tar.gz: 9aae4cc7e9f198f7bffecbba4b1ea9da6ae63bf550e769ac4908360c5af1c503dc0bbf907483e812889e7e873c1e293a6265c965c1b5848c0db60e771b1508e6
6
+ metadata.gz: 626f5f1bd5eff200d3cba82d0037a7c30b25e2989f691b696f9af4eb0251b1c4d2a37b645a54a53304d6c0b077e0fdc4d37f3264d4a3ee9614117565a27395e8
7
+ data.tar.gz: 16236d3d5c8ccf2a0561f214d2ca2b2e635fc2ba79cf26f8ff596323214868732959519dcd6623182c681336913e3a9026ed1e6d7dba9bfdf805223488c6211b
@@ -3,10 +3,15 @@ rvm:
3
3
  - 2.0
4
4
  - 2.1
5
5
  - 2.2
6
- - 2.3.2
6
+ - 2.3
7
+ - 2.4
8
+ - 2.5
7
9
  - ruby-head
8
10
  cache: bundler
9
11
  bundler_args: "--jobs=2"
12
+ before_install:
13
+ - gem update --system --no-document
14
+ - gem install bundler --no-document
10
15
  before_script:
11
16
  - export CODECLIMATE_REPO_TOKEN=329887587f83c7ce5a1ab75f426c00830ba5ffac290c90bc486713c88baea900
12
17
  - export COVERAGE=true
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
  ## master
3
- [full changelog](http://github.com/sue445/rspec-temp_dir/compare/v1.0.0...master)
3
+ [full changelog](http://github.com/sue445/rspec-temp_dir/compare/v1.1.0...master)
4
+
5
+ ## v1.1.0
6
+ [full changelog](http://github.com/sue445/rspec-temp_dir/compare/v1.0.0...v1.1.0)
7
+
8
+ * Impl within temp dir
9
+ * https://github.com/sue445/rspec-temp_dir/pull/13
4
10
 
5
11
  ## v1.0.0
6
12
  [full changelog](http://github.com/sue445/rspec-temp_dir/compare/v0.0.4...v1.0.0)
data/README.md CHANGED
@@ -2,13 +2,12 @@
2
2
 
3
3
  create automatically temporary directory at each examples
4
4
 
5
- This is inspired by Junit [TemporaryFolder](http://junit.org/apidocs/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
8
  [![Build Status](https://travis-ci.org/sue445/rspec-temp_dir.svg)](https://travis-ci.org/sue445/rspec-temp_dir)
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
13
  * ruby 2.0+
@@ -58,6 +57,15 @@ describe "uses temp dir" do
58
57
  it { should be_exist }
59
58
  end
60
59
  end
60
+
61
+ describe "within temp dir" do
62
+ # create temp dir and cd to temp dir
63
+ include_context "within temp dir"
64
+
65
+ it "within temp dir" do
66
+ expect(Dir.pwd).to eq temp_dir
67
+ end
68
+ end
61
69
  ```
62
70
 
63
71
  ## Contributing
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Rspec
2
2
  module TempDir
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
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
@@ -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
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: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-20 00:00:00.000000000 Z
11
+ date: 2018-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -104,7 +104,6 @@ files:
104
104
  - ".coveralls.yml"
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
- - ".tachikoma.yml"
108
107
  - ".travis.yml"
109
108
  - CHANGELOG.md
110
109
  - Gemfile
@@ -114,8 +113,10 @@ files:
114
113
  - lib/rspec/temp_dir.rb
115
114
  - lib/rspec/temp_dir/uses_temp_dir.rb
116
115
  - lib/rspec/temp_dir/version.rb
116
+ - lib/rspec/temp_dir/within_temp_dir.rb
117
117
  - rspec-temp_dir.gemspec
118
118
  - spec/rspec/uses_temp_dir_spec.rb
119
+ - spec/rspec/within_temp_dir_spec.rb
119
120
  - spec/spec_helper.rb
120
121
  homepage: https://github.com/sue445/rspec-temp_dir
121
122
  licenses:
@@ -137,10 +138,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
138
  version: '0'
138
139
  requirements: []
139
140
  rubyforge_project:
140
- rubygems_version: 2.5.1
141
+ rubygems_version: 2.7.6
141
142
  signing_key:
142
143
  specification_version: 4
143
144
  summary: create automatically temporary directory at each examples
144
145
  test_files:
145
146
  - spec/rspec/uses_temp_dir_spec.rb
147
+ - spec/rspec/within_temp_dir_spec.rb
146
148
  - spec/spec_helper.rb
@@ -1 +0,0 @@
1
- strategy: 'bundler'