Skip to content

Commit

Permalink
Refs #29104 - Adding a drpm unit type
Browse files Browse the repository at this point in the history
  • Loading branch information
parthaa committed Feb 20, 2020
1 parent b4af37e commit 1ed838c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/runcible/extensions/drpm.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module Runcible
module Extensions
class Drpm < Runcible::Extensions::Unit
def self.content_type
'drpm'
end

# This function is not implemented for RPMs since they do not have content IDs
def find
fail NotImplementedError
end

# This function is not implemented for RPMs since they do not have content IDs
def find_all
fail NotImplementedError
end

# This function is not implemented for RPMs since they do not have content IDs
def unassociate_ids_from_repo(repo_id, ids)
fail NotImplementedError
end
end
end
end
30 changes: 30 additions & 0 deletions test/extensions/drpm_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require 'rubygems'
require 'minitest/autorun'

require './lib/runcible'
require './test/extensions/unit_base'
require './test/support/repository_support'

module Extensions
class TestDrpm < MiniTest::Unit::TestCase
def self.before_suite
@@extension = TestRuncible.server.extensions.drpm
end

def self.after_suite
self.support.destroy_repo
end

def test_content_type
assert_equal 'drpm', @@extension.content_type
end

def test_find
assert_raises(NotImplementedError) { @@extension.find }
end

def test_find_all
assert_raises(NotImplementedError) { @@extension.find_all }
end
end
end

0 comments on commit 1ed838c

Please sign in to comment.