Revision aacd8973
Added by Bryan Kearney over 9 years ago
app/services/foreman/plugin.rb | ||
---|---|---|
plugin.description gem.description
|
||
plugin.url gem.homepage
|
||
plugin.version gem.version.to_s
|
||
plugin.path gem.full_gem_path
|
||
end
|
||
|
||
plugin.instance_eval(&block)
|
||
... | ... | |
end
|
||
end
|
||
|
||
def_field :name, :description, :url, :author, :author_url, :version
|
||
def_field :name, :description, :url, :author, :author_url, :version, :path
|
||
attr_reader :id
|
||
|
||
def initialize(id)
|
test/unit/plugin_test.rb | ||
---|---|---|
author_url 'http://example.net/jsmith'
|
||
description 'This is a test plugin'
|
||
version '0.0.1'
|
||
path '/some/path/on/disk'
|
||
end
|
||
|
||
assert_equal 1, @klass.all.size
|
||
... | ... | |
assert_equal 'http://example.net/jsmith', plugin.author_url
|
||
assert_equal 'This is a test plugin', plugin.description
|
||
assert_equal '0.0.1', plugin.version
|
||
assert_equal '/some/path/on/disk', plugin.path
|
||
end
|
||
|
||
def test_installed
|
Also available in: Unified diff
Fixes #8325 : Enhance the plugin object to use the gem path to understand where the plugin is installed