Sha256: 8ad34688dc96e0bd903fafdba018334e131f3b3eea8a0ec6d0d3d903ef69faee
Contents?: true
Size: 1.31 KB
Versions: 6
Compression:
Stored size: 1.31 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 end it "should have a logger" do PoolParty.log.should_not be_nil end end
Version data entries
6 entries across 6 versions & 2 rubygems