Sha256: 510383670dbc4fc1726a5619d17cad4ec36a0c0096e5b7da88cf06b62c26befb

Contents?: true

Size: 1.38 KB

Versions: 22

Compression:

Stored size: 1.38 KB

Contents

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

describe "PoolParty" do
  after(:all) do
    # FileUtils.rm_r(Default.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", Default.storage_directory + "/haymaker").once
    PoolParty.copy_file_to_storage_directory("haymaker")
  end
  describe "writing file to storage_directory" do
    before(:each) do
      @path = "#{Default.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 == nil
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
auser-poolparty-1.1.1 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.1.3 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.1.4 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.1.5 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.1.6 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.1.7 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.0 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.1 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.10 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.11 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.12 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.2 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.3 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.4 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.7 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.8 spec/poolparty/poolparty_spec.rb
auser-poolparty-1.2.9 spec/poolparty/poolparty_spec.rb
fairchild-poolparty-1.1.3 spec/poolparty/poolparty_spec.rb
fairchild-poolparty-1.1.4 spec/poolparty/poolparty_spec.rb
fairchild-poolparty-1.1.5 spec/poolparty/poolparty_spec.rb