Sha256: 906cfbd64212535e288af1b67e0ae33d859b276b2c1a69446cdfc72686d773a9

Contents?: true

Size: 873 Bytes

Versions: 15

Compression:

Stored size: 873 Bytes

Contents

require "spec_helper"

describe "Pliny integration test" do
  before(:all) do
    FileUtils.rm_rf("/tmp/plinytest")
    FileUtils.mkdir_p("/tmp/plinytest")
    Dir.chdir("/tmp/plinytest")

    bash "pliny-new myapp"
    bash_app "bin/setup"
  end

  describe "bin/setup" do
    it "generates .env" do
      assert File.exists?("./myapp/.env")
    end
  end

  describe "pliny-generate model" do
    before(:all) do
      bash_app "pliny-generate model artist"
    end

    it "creates the model file" do
      assert File.exists?("./myapp/lib/models/artist.rb")
    end
  end

  def bash(cmd)
    bin  = File.expand_path('../bin', File.dirname(__FILE__))
    path = "#{bin}:#{ENV["PATH"]}"
    env = { "PATH" => path }
    unless system(env, "#{cmd} > /dev/null")
      raise "Failed to run #{cmd}"
    end
  end

  def bash_app(cmd)
    bash "cd myapp && #{cmd}"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pliny-0.10.0 spec/integration_spec.rb
pliny-0.9.2 spec/integration_spec.rb
pliny-0.9.1 spec/integration_spec.rb
pliny-0.9.0 spec/integration_spec.rb
pliny-0.8.2 spec/integration_spec.rb
pliny-0.8.1 spec/integration_spec.rb
pliny-0.8.0 spec/integration_spec.rb
pliny-0.7.3 spec/integration_spec.rb
pliny-0.7.2 spec/integration_spec.rb
pliny-0.7.1 spec/integration_spec.rb
pliny-0.7.0 spec/integration_spec.rb
pliny-0.6.3 spec/integration_spec.rb
pliny-0.6.2 spec/integration_spec.rb
pliny-0.6.1 spec/integration_spec.rb
pliny-0.6.0 spec/integration_spec.rb