Reset file system before each run in storage_spec.rb
This commit is contained in:
parent
7096099b8a
commit
55c02e06df
|
@ -11,8 +11,8 @@ module Pigeon
|
|||
desc "new", "Creates a new identiy in `.pigeon` directory if none exists"
|
||||
|
||||
def new
|
||||
if Dir.exist?(Pigeon::Storage::ROOT_DIR)
|
||||
puts "Pigeon has detected a `.pigeon` directory.
|
||||
if File.file?(Pigeon::Storage::PIGEON_DB_PATH)
|
||||
puts "Pigeon has detected a `pigeon.db` file.
|
||||
Refusing to overwrite existing Pigeon config.
|
||||
Remove config dir or switch to a different directory."
|
||||
raise ConfigAlreadyExists
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# for quick QA.
|
||||
|
||||
echo "Deleting old pigeon configs"
|
||||
rm -rf .pigeon/
|
||||
rm -f db.pigeon
|
||||
echo "OK"
|
||||
|
||||
echo "Creating new config:"
|
||||
|
|
|
@ -2,9 +2,7 @@ require "spec_helper"
|
|||
|
||||
RSpec.describe "Kitch sink spec" do
|
||||
it "does everything" do
|
||||
$lol = true
|
||||
kp = Pigeon::KeyPair.new()
|
||||
$lol = false
|
||||
kp.save!
|
||||
Pigeon::KeyPair.current.public_key
|
||||
# ./pigeon-cli identity new
|
||||
|
|
|
@ -4,7 +4,10 @@ RSpec.describe Pigeon::Storage do
|
|||
LOGO_BLOB = File.read("./logo.png")
|
||||
IDS = %w(@_TlC2z3FT4fimecC4eytrBhOwhLUZsVBZEZriBO9cWs=.ed25519
|
||||
@28FyT7evjcYrrwngr8G2V1HZ0ODK0VPsFctDEZwfZJc=.ed25519)
|
||||
let(:s) { Pigeon::Storage.current }
|
||||
let(:s) do
|
||||
FileUtils.rm_r(Pigeon::Storage::PIGEON_DB_PATH)
|
||||
Pigeon::Storage.current
|
||||
end
|
||||
|
||||
it "deletes a config" do
|
||||
s.set_config("FOO", "BAR")
|
||||
|
|
Loading…
Reference in New Issue