Module: FixtureHelper

Extended by:
T::Sig
Defined in:
lib/packs/rspec/fixture_helper.rb

Overview

typed: strict frozen_string_literal: true

Instance Method Summary collapse

Instance Method Details

#delete_app_file(path) ⇒ Object



30
31
32
# File 'lib/packs/rspec/fixture_helper.rb', line 30

def delete_app_file(path)
  File.delete(path)
end

#write_file(path, content = '') ⇒ Object



8
9
10
11
12
13
# File 'lib/packs/rspec/fixture_helper.rb', line 8

def write_file(path, content = '')
  pathname = Pathname.pwd.join(path)
  FileUtils.mkdir_p(pathname.dirname)
  pathname.write(content)
  path
end

#write_pack(pack_name, config = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/packs/rspec/fixture_helper.rb', line 21

def write_pack(
  pack_name,
  config = {}
)
  path = Pathname.pwd.join(pack_name).join('package.yml')
  write_file(path.to_s, YAML.dump(config))
end