Sha256: 161454ee25d5ae37c73cc531c4bc0efa8d7cc5e7543f19fe3521da5c144abe85

Contents?: true

Size: 646 Bytes

Versions: 8

Compression:

Stored size: 646 Bytes

Contents

require "spec_helper"
require "shelly/cloudfile"

describe Shelly::Cloudfile do
  before do
    FileUtils.mkdir_p("/projects/foo")
    Dir.chdir("/projects/foo")
    @hash = {:code_name => {:code => "test"}}
    @client = mock
    Shelly::Client.stub(:new).and_return(@client)
    @cloudfile = Shelly::Cloudfile.new
  end

  describe "#hash converting" do
    it "should convert hash to proper string" do
      @cloudfile.yaml(@hash).should == "code_name:\n  code: test"
    end

    it "should convert a hash to yaml format" do
      @cloudfile.write(@hash)
      @cloudfile.open.should == {"code_name" => {"code" => "test"}}
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shelly-0.0.37 spec/shelly/cloudfile_spec.rb
shelly-0.0.36 spec/shelly/cloudfile_spec.rb
shelly-0.0.34 spec/shelly/cloudfile_spec.rb
shelly-0.0.33 spec/shelly/cloudfile_spec.rb
shelly-0.0.32 spec/shelly/cloudfile_spec.rb
shelly-0.0.31 spec/shelly/cloudfile_spec.rb
shelly-0.0.30 spec/shelly/cloudfile_spec.rb
shelly-0.0.29 spec/shelly/cloudfile_spec.rb