Basic rubocops

This commit is contained in:
Greg Myers
2020-03-24 16:02:13 +00:00
parent 5060697761
commit 6b4f49aacb
25 changed files with 171 additions and 165 deletions

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'generator_spec'
require 'generators/rspec/swagger_generator'
require 'tmpdir'
@@ -9,12 +11,11 @@ module Rspec
before(:all) do
prepare_destination
fixtures_dir = File.expand_path('../fixtures', __FILE__)
fixtures_dir = File.expand_path('fixtures', __dir__)
FileUtils.cp_r("#{fixtures_dir}/spec", destination_root)
end
after(:all) do
end
it 'installs the swagger_helper for rspec' do
@@ -31,11 +32,11 @@ module Rspec
def fake_routes
{
"/posts/{post_id}/comments/{id}" => {
:params => ["post_id", "id"],
:actions => {
"get" => { :summary=>"show comment" },
"patch" => { :summary=>"update_comments comment" }
'/posts/{post_id}/comments/{id}' => {
params: ['post_id', 'id'],
actions: {
'get' => { summary: 'show comment' },
'patch' => { summary: 'update_comments comment' }
}
}
}

View File

@@ -1,16 +1,17 @@
# frozen_string_literal: true
require 'generator_spec'
require 'generators/rswag/specs/install/install_generator'
module Rswag
module Specs
RSpec.describe InstallGenerator do
include GeneratorSpec::TestCase
destination File.expand_path('../tmp', __FILE__)
destination File.expand_path('tmp', __dir__)
before(:all) do
prepare_destination
fixtures_dir = File.expand_path('../fixtures', __FILE__)
fixtures_dir = File.expand_path('fixtures', __dir__)
FileUtils.cp_r("#{fixtures_dir}/spec", destination_root)
run_generator