From 97f979fe1ffd4f79733cc84e8bbaa90de0da7fa1 Mon Sep 17 00:00:00 2001 From: Trey Pendragon Date: Wed, 6 Sep 2023 10:05:51 -0700 Subject: [PATCH] Coverage --- lib/valkyrie/specs/shared_specs/storage_adapter.rb | 4 ++++ lib/valkyrie/storage/versioned_disk.rb | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/valkyrie/specs/shared_specs/storage_adapter.rb b/lib/valkyrie/specs/shared_specs/storage_adapter.rb index 15ffca70..6bff757f 100644 --- a/lib/valkyrie/specs/shared_specs/storage_adapter.rb +++ b/lib/valkyrie/specs/shared_specs/storage_adapter.rb @@ -18,6 +18,10 @@ class Valkyrie::Specs::CustomResource < Valkyrie::Resource it { is_expected.to respond_to(:upload).with_keywords(:file, :resource, :original_filename) } it { is_expected.to respond_to(:supports?) } + it "returns false for non-existing features" do + expect(storage_adapter.supports?(:bad_feature_not_real_dont_implement)).to eq false + end + it "can upload a file which is just an IO" do io_file = Tempfile.new('temp_io') io_file.write "Stuff" diff --git a/lib/valkyrie/storage/versioned_disk.rb b/lib/valkyrie/storage/versioned_disk.rb index ba800ab1..ccd82f1a 100644 --- a/lib/valkyrie/storage/versioned_disk.rb +++ b/lib/valkyrie/storage/versioned_disk.rb @@ -48,10 +48,6 @@ def versioned? string_id.include?("v-") end - def file_root - string_id.split("v-").first - end - def version string_id.split("v-").last.split("-", 2).first end