lib/souls/generate/rspec_mutation.rb in souls-0.21.1 vs lib/souls/generate/rspec_mutation.rb in souls-0.21.2

- old
+ new

@@ -2,11 +2,10 @@ module Generate class << self ## Generate Rspec Mutation def rspec_mutation_head class_name: "souls" file_path = "./spec/mutations/#{class_name.singularize}_spec.rb" - return "RspecMutation already exist! #{file_path}" if File.exist? file_path File.open(file_path, "w") do |f| f.write <<~EOS RSpec.describe \"#{class_name.camelize} Mutation テスト\" do describe "#{class_name.camelize} データを登録する" do EOS @@ -235,9 +234,11 @@ file_path end def rspec_mutation class_name: "souls" singularized_class_name = class_name.singularize + file_path = "./spec/mutations/#{singularized_class_name}_spec.rb" + return "RspecMutation already exist! #{file_path}" if File.exist? file_path rspec_mutation_head class_name: singularized_class_name rspec_mutation_after_head class_name: singularized_class_name rspec_mutation_params class_name: singularized_class_name rspec_mutation_params_response class_name: singularized_class_name rspec_mutation_end class_name: singularized_class_name