Sha256: 57f53410af234334c56799eea0114950e3c7e24cf54ebac7f807841a7aac2798

Contents?: true

Size: 720 Bytes

Versions: 3

Compression:

Stored size: 720 Bytes

Contents

describe DeployGate::Config do
  describe "#write" do
    it "write data" do
      write_data = {
          :name => 'test',
          :token => 'token'
      }
      allow(File).to receive(:open).and_return(StringIO.new("", "w+"))
      DeployGate::Config.write(write_data)

      file = File.open(DeployGate::Config.file_path)
      expect(file.string).to eq(write_data.to_json.to_s)
    end
  end

  describe "#read" do
    it "read data" do
      write_data = {
          :name => 'test',
          :token => 'token'
      }.to_json.to_s
      allow(File).to receive(:open).and_return(StringIO.new(write_data))
      data = DeployGate::Config.read

      expect(data).to eq(JSON.parse(write_data))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
deploygate-0.0.3 spec/deploygate/config_spec.rb
deploygate-0.0.2 spec/deploygate/config_spec.rb
deploygate-0.0.1 spec/deploygate/config_spec.rb