File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -191,21 +191,19 @@ def program
191191 def create_file
192192 path = "#{ __dir__ } /../debug/#{ @class . sub ( /(?i:t)est/ , '' ) . downcase } _test.rb"
193193 if File . exist? ( path )
194- File . open ( path , 'r' ) do |f |
195- lines = f . read
196- @content = lines . split ( "\n " ) [ 0 ..-3 ] . join ( "\n " ) + "\n #{ create_scenario } end\n end\n " if lines . include? @class
197- end
194+ lines = File . read ( path )
195+ content = lines . split ( "\n " ) [ 0 ..-3 ] . join ( "\n " ) + "\n #{ create_scenario } end\n end\n " if lines . include? @class
198196 end
199- if @ content
197+ if content
200198 puts "appended: #{ path } "
201199 else
202- @ content = content_with_module
200+ content = content_with_module
203201 puts "created: #{ path } "
204202 puts " class: #{ @class } "
205203 end
206204 puts " method: #{ @method } "
207205
208- File . write ( path , @ content)
206+ File . write ( path , content )
209207 end
210208
211209 def remove_temp_file
You can’t perform that action at this time.
0 commit comments