Sha256: 9aeee252eb6351ccefdd3893ae5e3a406526b6694119f2fdcc95facf7d2861e3

Contents?: true

Size: 764 Bytes

Versions: 5

Compression:

Stored size: 764 Bytes

Contents

module FoundationRailsTestHelpers
  def create_dummy_app
    FileUtils.cd(tmp_path) do
      %x(rails new dummy --skip-active-record --skip-test-unit --skip-spring --skip-bundle)
      File.open(dummy_app_path + '/Gemfile', 'a') do |f|
        f.puts "gem 'foundation-rails', path: '#{File.join(File.dirname(__FILE__), '..', '..')}'"
      end
    end
    FileUtils.cd(dummy_app_path) do
      %x(bundle install)
    end
  end

  def remove_dummy_app
    FileUtils.rm_rf(dummy_app_path)
  end

  def install_foundation
    FileUtils.cd(dummy_app_path) do
      puts %x(rails g foundation:install -f 2>&1)
    end
  end

  def dummy_app_path
    File.join(tmp_path, 'dummy')
  end

  def tmp_path
    @tmp_path ||= File.join(File.dirname(__FILE__), '..')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foundation-rails-6.9.0.0 spec/support/helpers.rb
foundation-rails-6.6.2.0 spec/support/helpers.rb
foundation-rails-6.6.1.0 spec/support/helpers.rb
foundation-rails-6.5.3.0 spec/support/helpers.rb
foundation-rails-6.5.1.0 spec/support/helpers.rb