Sha256: c5e441362320d596e9110a2c3f94e9f1f83847a7c7b50d519530cbeb6be6757b

Contents?: true

Size: 796 Bytes

Versions: 7

Compression:

Stored size: 796 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'spec_helper'

module OnStomp::Components::Scopes
  describe HeaderScope do
    let(:client) {
      OnStomp::Client.new("stomp:///")
    }
    let(:headers) {
      { :header1 => 'value 1', 'header2' => 'value 2'}
    }
    let(:scope) {
      HeaderScope.new headers, client
    }
    
    let(:frame_method_interface) { scope }
    it_should_behave_like "frame method interfaces"
    
    describe ".transmit" do
      it "should add all its headers to a frame, unless that header name is set" do
        client.stub(:transmit).and_return { |f,_| f }
        frame = scope.transmit OnStomp::Components::Frame.new('COMMAND', {:header2 => 'my value'})
        frame.should have_headers(:header1 => 'value 1', :header2 => 'my value')
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
onstomp-1.0.5 spec/onstomp/components/scopes/header_scope_spec.rb
onstomp-1.0.4 spec/onstomp/components/scopes/header_scope_spec.rb
onstomp-1.0.3 spec/onstomp/components/scopes/header_scope_spec.rb
onstomp-1.0.2 spec/onstomp/components/scopes/header_scope_spec.rb
onstomp-1.0.1 spec/onstomp/components/scopes/header_scope_spec.rb
onstomp-1.0.0 spec/onstomp/components/scopes/header_scope_spec.rb
onstomp-1.0.0pre1 spec/onstomp/components/scopes/header_scope_spec.rb