Sha256: 309309779080092e1b84e83b08eeb77d3b9c3b7ddbd2114ff270890066235320

Contents?: true

Size: 1.31 KB

Versions: 62

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.logger.should_not be_nil
  end
end

Version data entries

62 entries across 62 versions & 2 rubygems

Version Path
auser-poolparty-0.2.15 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.16 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.20 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.21 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.22 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.23 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.24 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.25 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.26 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.3 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.35 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.36 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.37 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.38 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.39 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.4 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.40 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.41 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.42 spec/poolparty/poolparty_spec.rb
auser-poolparty-0.2.44 spec/poolparty/poolparty_spec.rb