rspec-file_fixtures 0.1.7 → 0.1.8

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
2
  SHA256:
3
- metadata.gz: 5194a0d2db316e9e13a780c7e33a1af9a6ea1869c0ab254ee3e462fceb446ecc
4
- data.tar.gz: 734ed79bf2a160cd694cf3a5a8be8eef3278a08ae7c2aae2a00c6d12b263b4ba
3
+ metadata.gz: d978a8476e823c5ce576c9c394496825de1c415fe257e18190f8ab8568649c29
4
+ data.tar.gz: a1ef7422015b6d6be00907361d72b24c6587d8c078a0e344d81109bbcad0aa6e
5
5
  SHA512:
6
- metadata.gz: 1ef7bdc977c831a897242bc1e215865cd7b3c7246cf612e020f51fe1a90242f2e4ce6447eac47c0f0cb654558e44f9b86966166bd3495bf636225c6e441c5e72
7
- data.tar.gz: d34793287afaf62c2a5e35c5337031b969ec034917f4a29761eac902325f594f81535d2380e01357c08e6aa2072c0603198a107f1b263783a474ce5c6655a7ed
6
+ metadata.gz: 56a1fedb093df9f1729cda4d71477ed59e9016b72569bbc8a350b5e8c3008c448ecd18af9b7d17ab32a317f6d9bab5ecb0e26216875c4cfad3d7027177717b21
7
+ data.tar.gz: 8ed1023046adbf09ab8a613bc4b43985fe0534e1c7df2487235426e11251c66c19225d1e3ccc2a044f07c07496948808b797511ae51ac3d3a5c7571b5fdb6f5d
data/.rubocop.yml CHANGED
@@ -1,3 +1,6 @@
1
+ require:
2
+ - rubocop-rspec-documentation
3
+
1
4
  AllCops:
2
5
  NewCops: enable
3
6
 
data/Gemfile CHANGED
@@ -14,4 +14,5 @@ gem 'rspec-its', '~> 1.3'
14
14
  gem 'rubocop', '~> 1.52'
15
15
  gem 'rubocop-rake', '~> 0.6.0'
16
16
  gem 'rubocop-rspec', '~> 2.22'
17
+ gem 'rubocop-rspec-documentation', '~> 0.0.2'
17
18
  gem 'strong_versions', '~> 0.4.5'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-file_fixtures (0.1.6)
4
+ rspec-file_fixtures (0.1.8)
5
5
  rspec (~> 3.12)
6
6
 
7
7
  GEM
@@ -31,7 +31,6 @@ GEM
31
31
  racc (1.6.2)
32
32
  rainbow (3.1.1)
33
33
  rake (13.0.6)
34
- redcarpet (3.6.0)
35
34
  regexp_parser (2.8.0)
36
35
  rexml (3.2.5)
37
36
  rouge (4.1.2)
@@ -41,13 +40,12 @@ GEM
41
40
  rspec-mocks (~> 3.12.0)
42
41
  rspec-core (3.12.2)
43
42
  rspec-support (~> 3.12.0)
44
- rspec-documentation (0.0.5)
43
+ rspec-documentation (0.0.11)
45
44
  htmlbeautifier (~> 1.4)
46
45
  kramdown (~> 2.4)
47
46
  kramdown-parser-gfm (~> 1.1)
48
47
  nokogiri (~> 1.15)
49
48
  paintbrush (~> 0.1.3)
50
- redcarpet (~> 3.6)
51
49
  rouge (~> 4.1)
52
50
  rspec (~> 3.12)
53
51
  rspec-expectations (3.12.3)
@@ -82,6 +80,9 @@ GEM
82
80
  rubocop (~> 1.33)
83
81
  rubocop-capybara (~> 2.17)
84
82
  rubocop-factory_bot (~> 2.22)
83
+ rubocop-rspec-documentation (0.0.2)
84
+ rspec-documentation (~> 0.0.7)
85
+ rubocop (~> 1.52)
85
86
  ruby-progressbar (1.13.0)
86
87
  strong_versions (0.4.5)
87
88
  i18n (>= 0.5)
@@ -102,7 +103,8 @@ DEPENDENCIES
102
103
  rubocop (~> 1.52)
103
104
  rubocop-rake (~> 0.6.0)
104
105
  rubocop-rspec (~> 2.22)
106
+ rubocop-rspec-documentation (~> 0.0.2)
105
107
  strong_versions (~> 0.4.5)
106
108
 
107
109
  BUNDLED WITH
108
- 2.4.13
110
+ 2.4.14
data/Makefile CHANGED
@@ -13,5 +13,5 @@ test:
13
13
  .PHONY: publish
14
14
  publish:
15
15
  @RSPEC_DOCUMENTATION_URL_ROOT='/$(project)' bundle exec rspec-documentation
16
- @rsync --delete -r rspec-documentation/bundle/ docs01.bob.frl:/mnt/docs/$(project)/
16
+ @rsync --delete -r rspec-documentation/bundle/ docs.bob.frl:/var/www/html/$(project)/
17
17
  @echo 'Published.'
@@ -11,6 +11,11 @@ module RSpecFileFixtures
11
11
  pathname.read
12
12
  end
13
13
 
14
+ def copy_to(destination)
15
+ Pathname.new(destination).dirname.mkpath
16
+ FileUtils.copy(pathname, destination)
17
+ end
18
+
14
19
  def from_xml
15
20
  require 'nokogiri'
16
21
  Nokogiri::XML.parse(read)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RSpecFileFixtures
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
@@ -0,0 +1,16 @@
1
+ # Copy_to
2
+
3
+ You can use the `#copy_to(destination)` method to copy the fixture file to the destination path. The `#copy_to` method expects a path or string. See examples at [FileUtils#cp](https://rubyapi.org/3.3/o/fileutils#method-i-cp) method, which this method basically wraps. By using `#copy_to`, you can achieve faster file copying compared to the `File#read` then `File#write` approach, as it avoids loading the entire file into memory.
4
+
5
+ ```rspec:json
6
+ subject { File.read(destination_path).chomp }
7
+
8
+ let(:example_fixture) { fixture('example.json') }
9
+ let(:destination_path) { File.join(Dir.mktmpdir, 'path/to/destination/copied.json') }
10
+
11
+ before { example_fixture.copy_to(destination_path) }
12
+
13
+ after { File.unlink(destination_path) }
14
+
15
+ it { is_expected.to eql '{"key":"value"}' }
16
+ ```
@@ -1,3 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'tempfile'
4
+
3
5
  require 'rspec/file_fixtures'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-file_fixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-05 00:00:00.000000000 Z
11
+ date: 2023-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -52,7 +52,8 @@ files:
52
52
  - rspec-documentation/pages/010-Usage/010-JSON.md
53
53
  - rspec-documentation/pages/010-Usage/020-YAML.md
54
54
  - rspec-documentation/pages/010-Usage/030-XML.md
55
- - rspec-documentation/pages/010-Usage/040-Pathname.md
55
+ - rspec-documentation/pages/010-Usage/040-Copy_to.md
56
+ - rspec-documentation/pages/010-Usage/050-Pathname.md
56
57
  - rspec-documentation/pages/500-License.md
57
58
  - rspec-documentation/spec_helper.rb
58
59
  - rspec-file_fixtures.gemspec