packs 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/packs/rspec/fixture_helper.rb +33 -0
- data/lib/packs/rspec/support.rb +21 -0
- data/lib/packs.rb +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59f7fd3aee7635eabbe2a66c748b1083ced17b48c020fd628825ebb47239e7d9
|
4
|
+
data.tar.gz: e6d8964d6286a7ba822c15d81cc48f18017997477349ba7b13a3628a634b93e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a566117be564c25d46e673ea53c8d8d4d6fe04948d99d919236848314e5c8bc436b7287bb1cd7ba409bcf12b910d5befb842b0c608dd6d072132c59cd0840bc6
|
7
|
+
data.tar.gz: 043c964fa23f0603c8cccbc224e4129f00d86e42a40f3746b46fc550cdfd8a0f61f5c372306ea0548b5638d158629649aa3815cf5bd3c3fe1071ad211d3eadb4
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module FixtureHelper
|
5
|
+
extend T::Sig
|
6
|
+
|
7
|
+
sig { params(path: String, content: String).returns(String) }
|
8
|
+
def write_file(path, content = '')
|
9
|
+
pathname = Pathname.pwd.join(path)
|
10
|
+
FileUtils.mkdir_p(pathname.dirname)
|
11
|
+
pathname.write(content)
|
12
|
+
path
|
13
|
+
end
|
14
|
+
|
15
|
+
sig do
|
16
|
+
params(
|
17
|
+
pack_name: String,
|
18
|
+
config: T::Hash[T.untyped, T.untyped]
|
19
|
+
).void
|
20
|
+
end
|
21
|
+
def write_pack(
|
22
|
+
pack_name,
|
23
|
+
config = {}
|
24
|
+
)
|
25
|
+
path = Pathname.pwd.join(pack_name).join('package.yml')
|
26
|
+
write_file(path.to_s, YAML.dump(config))
|
27
|
+
end
|
28
|
+
|
29
|
+
sig { params(path: String).void }
|
30
|
+
def delete_app_file(path)
|
31
|
+
File.delete(path)
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'fixture_helper'
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
config.include FixtureHelper
|
5
|
+
|
6
|
+
config.before do
|
7
|
+
# We bust_cache always because each test may write its own packs
|
8
|
+
Packs.bust_cache!
|
9
|
+
end
|
10
|
+
|
11
|
+
# Eventually, we could make this opt-in via metadata so someone can use this support without affecting all their tests.
|
12
|
+
config.around do |example|
|
13
|
+
prefix = [File.basename($0), Process.pid].join('-') # rubocop:disable Style/SpecialGlobalVars
|
14
|
+
tmpdir = Dir.mktmpdir(prefix)
|
15
|
+
Dir.chdir(tmpdir) do
|
16
|
+
example.run
|
17
|
+
end
|
18
|
+
ensure
|
19
|
+
FileUtils.rm_rf(tmpdir)
|
20
|
+
end
|
21
|
+
end
|
data/lib/packs.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
@@ -121,6 +121,8 @@ files:
|
|
121
121
|
- lib/packs/pack.rb
|
122
122
|
- lib/packs/private.rb
|
123
123
|
- lib/packs/private/configuration.rb
|
124
|
+
- lib/packs/rspec/fixture_helper.rb
|
125
|
+
- lib/packs/rspec/support.rb
|
124
126
|
homepage: https://github.com/rubyatscale/packs
|
125
127
|
licenses:
|
126
128
|
- MIT
|