module Rambo
  module RSpec
    class SpecHelperFile

      TEMPLATE_PATH = File.expand_path('../templates/rambo_helper_file_template.erb', __FILE__)

      def generate
        write_template unless file_already_exists?
      end

      private

      def file_already_exists?
        File.exist?('spec/rambo_helper.rb')
      end

      def write_template
        File.open("spec/rambo_helper.rb", "w+") { |f| f.puts template }
      end

      def template
        @template ||= File.read(TEMPLATE_PATH)
      end
    end
  end
end

module Rambo
  module RSpec
    class SpecHelperFile

      TEMPLATE_PATH = File.expand_path('../templates/rambo_helper_file_template.erb', __FILE__)

      def generate
        write_to_file(template) unless file_already_exists?
      end

      private

      def file_already_exists?
        File.exist?('spec/rambo_helper.rb')
      end

      def write_to_file(template)
        File.open("spec/rambo_helper.rb", "w+") { |f| f.puts template }
      end

      def template
        @template ||= File.read(TEMPLATE_PATH)
      end
    end
  end
end

Add one more line of code coverage
Add one more line of code coverage
