lib/souls/generate/rspec_mutation.rb in souls-0.21.0 vs lib/souls/generate/rspec_mutation.rb in souls-0.21.1
- old
+ new
@@ -2,9 +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