2016-04-01 05:33:25 +08:00
|
|
|
require 'rails_helper'
|
2013-08-23 14:21:52 +08:00
|
|
|
require_dependency 'plugin/metadata'
|
|
|
|
|
|
|
|
describe Plugin::Metadata do
|
|
|
|
context "parse" do
|
|
|
|
it "correctly parses plugin info" do
|
|
|
|
metadata = Plugin::Metadata.parse <<TEXT
|
|
|
|
# name: plugin-name
|
|
|
|
# about: about: my plugin
|
|
|
|
# version: 0.1
|
|
|
|
# authors: Frank Zappa
|
2015-02-07 07:08:57 +08:00
|
|
|
# url: http://discourse.org
|
2015-04-28 01:06:53 +08:00
|
|
|
# required version: 1.3.0beta6+48
|
2013-08-23 14:21:52 +08:00
|
|
|
|
|
|
|
some_ruby
|
|
|
|
TEXT
|
|
|
|
|
2015-01-10 00:34:37 +08:00
|
|
|
expect(metadata.name).to eq("plugin-name")
|
|
|
|
expect(metadata.about).to eq("about: my plugin")
|
|
|
|
expect(metadata.version).to eq("0.1")
|
|
|
|
expect(metadata.authors).to eq("Frank Zappa")
|
2015-02-07 07:08:57 +08:00
|
|
|
expect(metadata.url).to eq("http://discourse.org")
|
2015-04-28 01:06:53 +08:00
|
|
|
expect(metadata.required_version).to eq("1.3.0beta6+48")
|
2013-08-23 14:21:52 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|