Sha256: 1255035665a2e3fc426da62909e5380c00de1a163bb1b7df2654d404bee27b13

Contents?: true

Size: 1.14 KB

Versions: 8

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe 'Outgoing frame draft 75' do
  let(:version) { 75 }
  let(:frame) { WebSocket::Frame::Outgoing.new(:version => version, :data => decoded_text, :type => frame_type) }
  let(:decoded_text) { "" }
  let(:encoded_text) { "\x00\xFF" }
  let(:frame_type) { :text }
  let(:require_sending) { true }
  let(:error) { nil }
  subject { frame }

  it_should_behave_like 'valid_outgoing_frame'

  context "should properly encode text frame" do
    let(:decoded_text) { "abc" }
    let(:encoded_text) { "\x00abc\xFF" }
    let(:require_sending) { true }

    it_should_behave_like 'valid_outgoing_frame'
  end

  context "should properly encode close frame" do
    let(:frame_type) { :close }
    let(:decoded_text) { "abc" }
    let(:encoded_text) { "\xFF\x00" }
    let(:require_sending) { true }

    it_should_behave_like 'valid_outgoing_frame'
  end

  context "should return error for unknown frame type" do
    let(:frame_type) { :unknown }
    let(:decoded_text) { "Hello" }
    let(:encoded_text) { nil }
    let(:error) { :unknown_frame_type }
    let(:require_sending) { false }

    it_should_behave_like 'valid_outgoing_frame'
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/websocket-1.0.6/spec/frame/outgoing_75_spec.rb
websocket-1.0.6 spec/frame/outgoing_75_spec.rb
websocket-1.0.5 spec/frame/outgoing_75_spec.rb
websocket-1.0.4 spec/frame/outgoing_75_spec.rb
websocket-1.0.3 spec/frame/outgoing_75_spec.rb
websocket-1.0.2 spec/frame/outgoing_75_spec.rb
websocket-1.0.1 spec/frame/outgoing_75_spec.rb
websocket-1.0.0 spec/frame/outgoing_75_spec.rb