mirror of
https://github.com/hkalexling/Mango.git
synced 2026-01-25 00:00:36 -05:00
Project-wise refactoring to follow Ameba
This commit is contained in:
@@ -2,7 +2,7 @@ require "./spec_helper"
|
||||
|
||||
describe Config do
|
||||
it "creates config if it does not exist" do
|
||||
with_default_config do |config, logger, path|
|
||||
with_default_config do |_, _, path|
|
||||
File.exists?(path).should be_true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ include MangaDex
|
||||
|
||||
describe Queue do
|
||||
it "creates DB at given path" do
|
||||
with_queue do |queue, path|
|
||||
with_queue do |_, path|
|
||||
File.exists?(path).should be_true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,9 +28,9 @@ def get_tempfile(name)
|
||||
if path.nil? || !File.exists? path
|
||||
file = File.tempfile name
|
||||
State.set name, file.path
|
||||
return file
|
||||
file
|
||||
else
|
||||
return File.new path
|
||||
File.new path
|
||||
end
|
||||
end
|
||||
|
||||
@@ -43,7 +43,7 @@ def with_default_config
|
||||
end
|
||||
|
||||
def with_storage
|
||||
with_default_config do |config, logger|
|
||||
with_default_config do |_, logger|
|
||||
temp_db = get_tempfile "mango-test-db"
|
||||
storage = Storage.new temp_db.path, logger
|
||||
clear = yield storage, temp_db.path
|
||||
@@ -54,7 +54,7 @@ def with_storage
|
||||
end
|
||||
|
||||
def with_queue
|
||||
with_default_config do |config, logger|
|
||||
with_default_config do |_, logger|
|
||||
temp_queue_db = get_tempfile "mango-test-queue-db"
|
||||
queue = MangaDex::Queue.new temp_queue_db.path, logger
|
||||
clear = yield queue, temp_queue_db.path
|
||||
|
||||
@@ -2,7 +2,7 @@ require "./spec_helper"
|
||||
|
||||
describe Storage do
|
||||
it "creates DB at given path" do
|
||||
with_storage do |storage, path|
|
||||
with_storage do |_, path|
|
||||
File.exists?(path).should be_true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user