Sha256: 910720800241c432335a16cc43e4567788d1a268871fbf6310c56d331f0f4768

Contents?: true

Size: 1.55 KB

Versions: 64

Compression:

Stored size: 1.55 KB

Contents

Dir.chdir File.join File.dirname(__FILE__), '../../../'
require './lib/flok'
require './spec/env/etc'

RSpec.describe "lib/project" do
  it "can list project_template files" do
    ls = Flok::Project.list
    #Subject to change but it's just a basic test
    expect(ls).to include("Gemfile")
    expect(ls).to include("app/controllers")
  end

  it "can create project_template files" do
    dir = new_temp_dir
    Dir.chdir dir do
      Flok::Project.create "test"
      Dir.chdir "test" do
        #This is subject to change, but it's just a basic test
        expect(dirs).to include("app")
        expect(dirs).to include("app/controllers")
        expect(files).to include("Gemfile")
      end
    end
  end

  it "Does contain a copy of the config.yml for the currently active platform in ./config/platforms/$PLATFORM/config.yml" do
    platform = ENV['PLATFORM']

    dir = new_temp_dir
    Dir.chdir dir do
      Flok::Project.create "test"
      Dir.chdir "test" do
        #Directory ./config/platforms/$PLATFORM should exist
        expect(dirs).to include("config/platforms/#{platform}")
        
        #File ./config/platforms/$PLATFORM/config.yml should exist
        Dir.chdir "./config/platforms/#{platform}" do
          expect(files).to include("config.yml")
        end

        #Files should match in config
        platform_config_path = File.join(File.dirname(__FILE__), "../../../app/drivers/#{platform}/config.yml")
        expect(File.read("./config/platforms/#{platform}/config.yml").strip).to eq(File.read(platform_config_path).strip)
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
flok-0.0.105 spec/etc/lib/project_spec.rb
flok-0.0.103 spec/etc/lib/project_spec.rb
flok-0.0.102 spec/etc/lib/project_spec.rb
flok-0.0.101 spec/etc/lib/project_spec.rb
flok-0.0.100 spec/etc/lib/project_spec.rb
flok-0.0.99 spec/etc/lib/project_spec.rb
flok-0.0.98 spec/etc/lib/project_spec.rb
flok-0.0.97 spec/etc/lib/project_spec.rb
flok-0.0.96 spec/etc/lib/project_spec.rb
flok-0.0.95 spec/etc/lib/project_spec.rb
flok-0.0.94 spec/etc/lib/project_spec.rb
flok-0.0.93 spec/etc/lib/project_spec.rb
flok-0.0.92 spec/etc/lib/project_spec.rb
flok-0.0.91 spec/etc/lib/project_spec.rb
flok-0.0.90 spec/etc/lib/project_spec.rb
flok-0.0.89 spec/etc/lib/project_spec.rb
flok-0.0.88 spec/etc/lib/project_spec.rb
flok-0.0.87 spec/etc/lib/project_spec.rb
flok-0.0.86 spec/etc/lib/project_spec.rb
flok-0.0.85 spec/etc/lib/project_spec.rb