FEATURE: adds a add_report method accessible in plugin.rb
This commit is contained in:
parent
7eff64773c
commit
24c27b5321
|
@ -92,6 +92,14 @@ class Plugin::Instance
|
|||
end
|
||||
end
|
||||
|
||||
def add_report(name, &block)
|
||||
reloadable_patch do |plugin|
|
||||
if plugin.enabled?
|
||||
Report.add_report(name, &block)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def replace_flags
|
||||
settings = ::FlagSettings.new
|
||||
yield settings
|
||||
|
|
|
@ -116,6 +116,15 @@ describe Plugin::Instance do
|
|||
end
|
||||
end
|
||||
|
||||
context "#add_report" do
|
||||
it "adds a report" do
|
||||
plugin = Plugin::Instance.new nil, "/tmp/test.rb"
|
||||
plugin.add_report("readers") {}
|
||||
|
||||
expect(Report.respond_to?(:report_readers)).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context "activate!" do
|
||||
it "can activate plugins correctly" do
|
||||
plugin = Plugin::Instance.new
|
||||
|
|
Loading…
Reference in New Issue