Sha256: fcbb8d2f2d1eb5d56c4e7b51d7984ec85ddc9fb8ffcdf9816fa4eed3be361bc2
Contents?: true
Size: 1.31 KB
Versions: 65
Compression:
Stored size: 1.31 KB
Contents
require "buildtasks/build/spec_helper" describe "build:copy" do include SC::SpecHelpers include SC::BuildSpecHelpers before do std_before @task_name = 'build:copy' @entry = @manifest.entry_for('demo.html') @src_path = @entry.source_path @dst_path = @entry.build_path @entry.build_task.should == 'build:copy' # precondition end after do std_after end it "copies from source to dst_path if dst_path does not exist" do File.exist?(@dst_path).should be_false # precondition run_task @entry, @dst_path files_eql(@src_path, @dst_path).should be_true end it "does not run if newer file exists at dst_path" do write_dummy(@dst_path) make_newer(@dst_path, @src_path) run_task is_dummy(@dst_path).should be_true # make sure task did not copy end it "replaces dst_path if older file exists at dst_path" do write_dummy(@dst_path) make_newer(@src_path, @dst_path) run_task is_dummy(@dst_path).should be_false # should overrwite older file files_eql(@src_path, @dst_path).should be_true end it "does not run if dst_path == src_path" do task = @buildfile.lookup('build:copy') expected_count = task.execute_count @dst_path = @src_path run_task task.execute_count.should == expected_count # did not execute! end end
Version data entries
65 entries across 65 versions & 1 rubygems