Class: MinitestSpecConverter::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest_spec_converter/converter.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Converter

Returns a new instance of Converter.



7
8
9
# File 'lib/minitest_spec_converter/converter.rb', line 7

def initialize(file)
  @file = file
end

Instance Method Details

#convertObject



11
12
13
14
15
16
# File 'lib/minitest_spec_converter/converter.rb', line 11

def convert
  content = File.read(@file)
  converted_content = convert_content(content)
  File.write(@file, converted_content)
  puts "Converted:  #{@file}"
end