Sha256: ae0da53e5cb386e562281aba45eab08aabfac03537e916af54059df6321174d9

Contents?: true

Size: 769 Bytes

Versions: 12

Compression:

Stored size: 769 Bytes

Contents

require 'spec_helper'
require 'stringio'

describe Vx::Message do

  %w{ PerformBuild PerformJob BuildLog JobLog BuildStatus JobStatus }.each do |klass|

    context "#{klass}" do

      let(:inst) { described_class.const_get klass }
      subject { inst.test_message }

      it "should be valid" do
        expect(subject.validate!).to be_true
      end

      it "should be successfuly serialized/deserialized" do
        bytes = subject.encode
        obj = described_class.const_get(klass).decode(bytes)
        expect(obj.validate!).to be_true
        expect(obj).to eq subject
      end

      if klass == 'JobStatus'
        it "should have matrix" do
          expect(subject.matrix).to eq ["env:FOO = 1", "rvm:1.9.3"]
        end
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
vx-message-0.2.1 spec/lib/message_spec.rb
vx-message-0.2.0.pre38 spec/lib/message_spec.rb
vx-message-0.2.0.pre37 spec/lib/message_spec.rb
vx-message-0.2.0.pre36 spec/lib/message_spec.rb
vx-message-0.2.0.pre35 spec/lib/message_spec.rb
vx-message-0.2.0.pre34 spec/lib/message_spec.rb
vx-message-0.2.0.pre33 spec/lib/message_spec.rb
vx-message-0.2.0.pre32 spec/lib/message_spec.rb
vx-message-0.2.0.pre31 spec/lib/message_spec.rb
vx-message-0.2.0.pre30 spec/lib/message_spec.rb
vx-message-0.2.0.pre29 spec/lib/message_spec.rb
vx-message-0.2.0.pre28 spec/lib/message_spec.rb