Sha256: 86383c20f25b3d7326d1f5bed5a43c636ae82acc13fea5ac651ebac8109b96e7

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe "PoolParty" do
  after(:all) do
    # FileUtils.rm_r(Base.storage_directory) rescue ""
  end
  it "should have the method copy_file_to_storage_directory on the PoolParty" do
    PoolParty.respond_to?(:copy_file_to_storage_directory).should == true
  end
  it "should copy the file given with File" do
    FileUtils.should_receive(:cp).with("haymaker", Base.storage_directory + "/haymaker").once
    PoolParty.copy_file_to_storage_directory("haymaker")
  end
  describe "writing file to storage_directory" do
    before(:each) do
      @path = "#{Base.storage_directory}/happydayz"
    end
    it "should have the method write_to_file_in_storage_directory" do
      PoolParty.respond_to?(:write_to_file_in_storage_directory).should == true
    end
    it "should receive File.new with the name of the file" do
      File.should_receive(:open).with(@path, "w+").once.and_return true
      PoolParty.write_to_file_in_storage_directory("/usr/bin/happydayz", "write this text")
    end
    it "should write the contents of the file to the file" do
      PoolParty.write_to_file_in_storage_directory("/usr/bin/happydayz", "write this text")
      File.open(@path).read.should == "write this text"
    end
    after(:each) do
      ::FileUtils.rm @path rescue ""
    end
  end
  it "should have a logger" do
    PoolParty.log.should_not be_nil
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
auser-poolparty-0.2.91 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.92 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.93 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.94 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.0.0 spec/poolparty/poolparty_spec.rb