Sha256: 7e33a0e61025c67fd61f1223afaffe49ef4d818f9eea593e7937b619a5fa196d

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 & 1 rubygems

Version Path
shenandoah-0.2.0 spec/shenandoah/rails/tasks_spec.rb
shenandoah-0.1.3 spec/shenandoah/rails/tasks_spec.rb