Sha256: f8917260ba43204dc8c7de86cb49f06ce57325ec8c43e2ea6710432fb2d7ad79

Contents?: true

Size: 903 Bytes

Versions: 4

Compression:

Stored size: 903 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")

require 'shenandoah/locator'
require 'shenandoah/rails/locator'
require 'shenandoah/rails/tasks'

describe Shenandoah::Rails::Tasks do
  include Shenandoah::Spec::Tmpfile
  
  before do
    RAILS_ROOT = tmpdir('rails')
  end

  after do
    Object.instance_eval { remove_const :RAILS_ROOT }
  end

  it "uses a rails locator by default" do
    Shenandoah::Rails::Tasks.new.locator.class.
      should == Shenandoah::Rails::Locator
  end

  it "passes overrides to the rails locator" do
    Shenandoah::Rails::Tasks.new(:main_path => "app/js").locator.
      main_path.should == "#{tmpdir}/rails/app/js"
  end

  it "uses the explicitly provided locator over all others" do
    loc = Shenandoah::DefaultLocator.new(:main_path => '/foo')
    Shenandoah::Rails::Tasks.new(:locator => loc).locator.main_path.should == '/foo'
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rsutphin-shenandoah-0.1.1 spec/shenandoah/rails/tasks_spec.rb
rsutphin-shenandoah-0.1.2 spec/shenandoah/rails/tasks_spec.rb
shenandoah-0.1.1 spec/shenandoah/rails/tasks_spec.rb
shenandoah-0.1.2 spec/shenandoah/rails/tasks_spec.rb