Sha256: 2263486d145322d008903b8a70375ca008ea5fedbe4e65dcbd0152dcfe86f7fe

Contents?: true

Size: 908 Bytes

Versions: 48

Compression:

Stored size: 908 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

  it "should allow improper yaml that works with syck" do
    yaml = %Q{domains:
  - *.example.com
  - example.com
    }
    expect {
      yaml = YAML.load(yaml)
    }.to_not raise_error
    yaml.should == {"domains" => ["*.example.com", "example.com"]}
  end

end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
shelly-0.1.6 spec/shelly/cloudfile_spec.rb
shelly-0.1.5 spec/shelly/cloudfile_spec.rb
shelly-0.1.4.pre2 spec/shelly/cloudfile_spec.rb
shelly-0.1.4.pre spec/shelly/cloudfile_spec.rb
shelly-0.1.3 spec/shelly/cloudfile_spec.rb
shelly-0.1.2 spec/shelly/cloudfile_spec.rb
shelly-0.1.1 spec/shelly/cloudfile_spec.rb
shelly-0.1.0 spec/shelly/cloudfile_spec.rb
shelly-0.0.62 spec/shelly/cloudfile_spec.rb
shelly-0.0.61 spec/shelly/cloudfile_spec.rb
shelly-0.0.60 spec/shelly/cloudfile_spec.rb
shelly-0.0.59 spec/shelly/cloudfile_spec.rb
shelly-0.0.58 spec/shelly/cloudfile_spec.rb
shelly-0.0.57 spec/shelly/cloudfile_spec.rb
shelly-0.0.56 spec/shelly/cloudfile_spec.rb
shelly-0.0.55 spec/shelly/cloudfile_spec.rb
shelly-0.0.55.pre spec/shelly/cloudfile_spec.rb
shelly-0.0.54 spec/shelly/cloudfile_spec.rb
shelly-0.0.53 spec/shelly/cloudfile_spec.rb
shelly-0.0.52 spec/shelly/cloudfile_spec.rb