spec/support/outgoing_frames.rb in websocket-1.2.4 vs spec/support/outgoing_frames.rb in websocket-1.2.5
- old
+ new
@@ -1,13 +1,33 @@
RSpec.shared_examples_for 'valid_outgoing_frame' do
- its(:class) { is_expected.to eql(WebSocket::Frame::Outgoing) }
- its(:version) { is_expected.to eql(version) }
- its(:type) { is_expected.to eql(frame_type) }
- its(:data) { is_expected.to eql(decoded_text) }
- its(:to_s) { is_expected.to eql(encoded_text) }
+ it 'is outgoing frame' do
+ expect(subject.class).to be WebSocket::Frame::Outgoing
+ end
+ it 'is in proper verions' do
+ expect(subject.version).to eql version
+ end
+
+ it 'has proper type set' do
+ expect(subject.type).to eql frame_type
+ end
+
+ it 'contains decoded data' do
+ expect(subject.data).to eql(decoded_text)
+ end
+
+ it 'returns encoded data as to_s' do
+ expect(subject.to_s).to eql(encoded_text)
+ end
+
context 'after parsing' do
- before(:each) { subject.to_s }
- its(:error) { is_expected.to eql(error) }
- its(:require_sending?) { is_expected.to eql(require_sending) }
+ before { subject.to_s }
+
+ it 'has valid errors set' do
+ expect(subject.error).to eql error
+ end
+
+ it 'requires sending' do
+ expect(subject.require_sending?).to eql require_sending
+ end
end
end