Sha256: 3cce18ac8deb930343bb66a323806891aff8f6bc3d96b0c1e812c435a7e65ba9

Contents?: true

Size: 820 Bytes

Versions: 3

Compression:

Stored size: 820 Bytes

Contents

require 'spec_helper'

describe "Rails support" do
  before do
    require "yacht_loader/rails"
    @yacht_dir = "/path/to/rails/config/yacht"
  end

  describe :environment do
    before do
      Rails = stub("Rails")
    end
    it "uses the current rails environment by default" do
      Rails.should_receive(:env)

      YachtLoader.environment
    end
  end

  describe :dir do
    it "uses config/yacht by default" do
      Rails.stub_chain(:root, :join).and_return(@yacht_dir)

      YachtLoader.dir.should == @yacht_dir
    end
  end

  describe :full_file_path_for_config do
    it "calls dir.join" do
      fake_dir = stub("dir stub")
      YachtLoader.stub(:dir).and_return(fake_dir)
      fake_dir.should_receive(:join).with("some.yml")

      YachtLoader.full_file_path_for_config("some")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yacht-0.1.2 spec/yacht_loader/rails_spec.rb
yacht-0.1.1 spec/yacht_loader/rails_spec.rb
yacht-0.1.0 spec/yacht_loader/rails_spec.rb