Sha256: 9a7a3e7f20830734f4f14035339dd98760c0030cc49fd3de3af3f97fce51baf8

Contents?: true

Size: 872 Bytes

Versions: 9

Compression:

Stored size: 872 Bytes

Contents

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

describe "app rake tasks" do
  before(:all) do # do this only once before all tests
    @rake = Rake::Application.new
    Rake.application = @rake
    Rake.application.rake_require "lib/tasks/surveyor_tasks"
    Rake::Task.define_task(:environment)
  end
  after do # after every test
    @rake[@task_name].reenable if @task_name
  end

  it "should have 'environment' as a prereq" do
    @task_name = "surveyor:parse"
    @rake[@task_name].prerequisites.should include("environment")
  end
  it "should should trace" do
    ENV["FILE"]="surveys/kitchen_sink_survey.rb"
    @task_name = "surveyor:parse"
    @rake.options.trace = true
    Surveyor::Parser.should_receive(:parse).with(File.read(File.join(Rails.root, ENV["FILE"])), {:trace => true})
    @rake[@task_name].invoke
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
upgrade_surveyor-1.4.2 spec/lib/tasks_spec.rake
affectiva-surveyor-1.5.0.pre.disco.2 spec/lib/tasks_spec.rake
hssc_surveyor-1.4.3.pre spec/lib/tasks_spec.rake
hssc_surveyor-1.4.2.pre spec/lib/tasks_spec.rake
hssc_surveyor-1.4.1.pre spec/lib/tasks_spec.rake
surveyor-1.4.0 spec/lib/tasks_spec.rake
surveyor-1.3.0 spec/lib/tasks_spec.rake
surveyor-1.2.0 spec/lib/tasks_spec.rake
surveyor-1.1.0 spec/lib/tasks_spec.rake