Sha256: 8a53a444bf14131570d91600c8f846f560a41cb8170b3a43c7e105ab41934152

Contents?: true

Size: 1019 Bytes

Versions: 6

Compression:

Stored size: 1019 Bytes

Contents

require 'spec_helper'

describe Ircp::Prefix do
  describe '#initialize' do
    context 'with servername' do
      before { @prefix = Ircp::Prefix.new(:servername => 'example.com') }
      subject { @prefix }
      its(:servername) { should eq 'example.com' }
    end

    context 'with nick, user and host' do
      before { @prefix = Ircp::Prefix.new(:nick => 'foo', :user => 'bar', :host => 'example.com') }
      subject { @prefix }
      its(:nick) { should eq 'foo' }
      its(:user) { should eq 'bar' }
      its(:host) { should eq 'example.com' }
    end
  end

  describe '#to_s' do
    context 'with servername' do
      before { @prefix = Ircp::Prefix.new(:servername => 'example.com') }
      subject { @prefix }
      its(:to_s) { should eq 'example.com' }
    end

    context 'with nick, user and host' do
      before { @prefix = Ircp::Prefix.new(:nick => 'foo', :user => 'bar', :host => 'example.com') }
      subject { @prefix }
      its(:to_s) { should eq 'foo!bar@example.com' }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ircp-1.1.8 spec/ircp/prefix_spec.rb
ircp-1.1.7 spec/ircp/prefix_spec.rb
ircp-1.1.6 spec/ircp/prefix_spec.rb
ircp-1.1.5 spec/ircp/prefix_spec.rb
ircp-1.1.4 spec/ircp/prefix_spec.rb
ircp-1.1.3 spec/ircp/prefix_spec.rb