Sha256: a87e6221d0d61f4eb6c6e9c73fcbceceecc0f506a5f0d7a1b00f9c2878767b42

Contents?: true

Size: 1.27 KB

Versions: 19

Compression:

Stored size: 1.27 KB

Contents

require File.dirname(__FILE__) + "/../../spec_helper"
require 'imw/dataset/workflow'
describe IMW::Workflow do

  before do
    @dataset = IMW::Dataset.new :testing
  end

  it "should dynamically define methods for each workflow step" do
    @dataset.workflow_steps.each do |step|
      @dataset.respond_to?(step).should be_true
    end
  end

  describe "initializing workflow" do
    it "should not make any directories if no tasks are invoked" do
      @dataset.path_to(:root).should_not contain(*@dataset.workflow_dirs.map(&:to_s))
    end

    it "should only make directories once a task is invoked" do
      @dataset[:initialize].invoke
      @dataset.path_to(:root).should contain(*@dataset.workflow_dirs.map(&:to_s))
    end
  end

  describe "cleaning workflow directories" do
    it "should clean without error even if there's nothing to clean" do
      @dataset[:clean].invoke
      @dataset.path_to(:root).should_not contain(*@dataset.workflow_dirs.map(&:to_s))
    end

    it "should remove workflow directories when invoked" do
      @dataset[:initialize].invoke
      IMWTest::Random.file(@dataset.path_to(:ripd, 'foobar.txt')) # put a file in
      @dataset[:clean].invoke
      @dataset.path_to(:root).should_not contain(*@dataset.workflow_dirs.map(&:to_s))
    end
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
imw-0.2.18 spec/imw/dataset/workflow_spec.rb
imw-0.2.17 spec/imw/dataset/workflow_spec.rb
imw-0.2.16 spec/imw/dataset/workflow_spec.rb
imw-0.2.15 spec/imw/dataset/workflow_spec.rb
imw-0.2.14 spec/imw/dataset/workflow_spec.rb
imw-0.2.13 spec/imw/dataset/workflow_spec.rb
imw-0.2.12 spec/imw/dataset/workflow_spec.rb
imw-0.2.11 spec/imw/dataset/workflow_spec.rb
imw-0.2.10 spec/imw/dataset/workflow_spec.rb
imw-0.2.9 spec/imw/dataset/workflow_spec.rb
imw-0.2.8 spec/imw/dataset/workflow_spec.rb
imw-0.2.7 spec/imw/dataset/workflow_spec.rb
imw-0.2.6 spec/imw/dataset/workflow_spec.rb
imw-0.2.5 spec/imw/dataset/workflow_spec.rb
imw-0.2.4 spec/imw/dataset/workflow_spec.rb
imw-0.2.3 spec/imw/dataset/workflow_spec.rb
imw-0.2.2 spec/imw/dataset/workflow_spec.rb
imw-0.2.1 spec/imw/dataset/workflow_spec.rb
imw-0.2.0 spec/imw/dataset/workflow_spec.rb