Sha256: dd7ee39e9349618bf01fbc2d68cd855dff0213bf985659b96bc96b3b67f4ec11
Contents?: true
Size: 658 Bytes
Versions: 4
Compression:
Stored size: 658 Bytes
Contents
module RSpec module Rails module View def create_view name, content file = view_file_name(name) unless File.exist?(file) FileUtils.mkdir_p File.dirname(file) File.open(file, 'w') do |f| f.puts content end end end def remove_view name file = view_file_name(name) FileUtils.rm_f(file) if File.exist?(file) end def remove_views *names names.each{|name| remove_view name } end def view_file_name name File.join(::Rails.root, "app/views/#{name}.rb") end end end end
Version data entries
4 entries across 4 versions & 1 rubygems