Commit 9bb899ba authored by Laurent Briais's avatar Laurent Briais

Improved generated plugin tests skeleton.

parent adb536b0
Pipeline #95124968 passed with stage
in 1 minute and 5 seconds
......@@ -4,22 +4,27 @@ RSpec.describe <%= plugin_module_name %> do
temporary_project 'test_project', scope: :all
let(:plugin_list) { 'plugin --list' }
let(:test_entity) { '<%= plugin_name %>/test_<%= plugin_name %>' }
let(:create_release) { "create #{test_entity}" }
let(:get_release) { "get #{test_entity}" }
let(:test_entity) { '<%= plugin_name %>_entity/test_<%= plugin_name %>' }
let(:create_<%= plugin_name %>) { "create #{test_entity}" }
let(:get_<%= plugin_name %>) { "get #{test_entity}" }
it 'has a version number' do
expect(<%= plugin_module_name %>::VERSION).not_to be nil
end
it 'should add a <%= plugin_name %> sub-command' do
expect(`#{temporary_project_cmd info_cmd}`).to match '- <%= plugin_name %>'
it 'should add a "<%= plugin_name %>" sub-command' do
expect(`#{temporary_project_cmd plugin_list}`).to match '- <%= plugin_name %>'
end
it 'should be possible to create a release' do
`#{temporary_project_cmd create_release}`
it 'should be possible to create a "<%= plugin_name %>_entity"' do
`#{temporary_project_cmd create_<%= plugin_name %>}`
expect($?.success?).to be_truthy
expect(`#{temporary_project_cmd get_release}`).not_to be_empty
expect(`#{temporary_project_cmd get_<%= plugin_name %>}`).not_to be_empty
end
it 'should do something useful' do
pending 'Tests implementation'
RSpec.fail
end
end
......@@ -4,22 +4,27 @@ RSpec.describe <%= plugin_module_name %> do
temporary_project 'test_project', scope: :all
let(:plugin_list) { 'plugin --list' }
let(:test_entity) { '<%= plugin_name %>/test_<%= plugin_name %>' }
let(:create_release) { "create #{test_entity}" }
let(:get_release) { "get #{test_entity}" }
let(:test_entity) { '<%= plugin_name %>_entity/test_<%= plugin_name %>' }
let(:create_<%= plugin_name %>) { "create #{test_entity}" }
let(:get_<%= plugin_name %>) { "get #{test_entity}" }
it 'has a version number' do
expect(<%= plugin_module_name %>::VERSION).not_to be nil
end
it 'should add a <%= plugin_name %> sub-command' do
expect(`#{temporary_project_cmd info_cmd}`).to match '- <%= plugin_name %>'
it 'should add a "<%= plugin_name %>" sub-command' do
expect(`#{temporary_project_cmd plugin_list}`).to match '- <%= plugin_name %>'
end
it 'should be possible to create a release' do
`#{temporary_project_cmd create_release}`
it 'should be possible to create a "<%= plugin_name %>_entity"' do
`#{temporary_project_cmd create_<%= plugin_name %>}`
expect($?.success?).to be_truthy
expect(`#{temporary_project_cmd get_release}`).not_to be_empty
expect(`#{temporary_project_cmd get_<%= plugin_name %>}`).not_to be_empty
end
it 'should do something useful' do
pending 'Tests implementation'
RSpec.fail
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment