Sha256: bba501cdbaebc51dd0c807b7e4be0aabfda943c23bfd9095d457bb6ca6d3e5f2

Contents?: true

Size: 901 Bytes

Versions: 2

Compression:

Stored size: 901 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

2 entries across 2 versions & 2 rubygems

Version Path
rsutphin-shenandoah-0.1.0 spec/shenandoah/rails/tasks_spec.rb
shenandoah-0.1.0 spec/shenandoah/rails/tasks_spec.rb