Sha256: 089d715db51f31c9d926fe4c3022a877c1db1de83444830834e72d01fc82ed32
Contents?: true
Size: 1.14 KB
Versions: 22
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' require 'shared/model_behaviour' describe Ably::Models::ChannelStateChange do let(:unique) { random_str } subject { Ably::Models::ChannelStateChange } context '#current' do it 'is required' do expect { subject.new(previous: true) }.to raise_error ArgumentError end it 'is an attribute' do expect(subject.new(current: unique, previous: true).current).to eql(unique) end end context '#previous' do it 'is required' do expect { subject.new(current: true) }.to raise_error ArgumentError end it 'is an attribute' do expect(subject.new(previous: unique, current: true).previous).to eql(unique) end end context '#reason' do it 'is not required' do expect { subject.new(previous: true, current: true) }.to_not raise_error end it 'is an attribute' do expect(subject.new(reason: unique, previous: unique, current: true).reason).to eql(unique) end end context 'invalid attributes' do it 'raises an argument error' do expect { subject.new(invalid: true, current: true, previous: true) }.to raise_error ArgumentError end end end
Version data entries
22 entries across 22 versions & 2 rubygems