Sha256: 4412b80a22ad8f24847736bb34867b4b1b854d7232122372a2b559a9f1afed21

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

# -*- coding: utf-8 -*-
require_relative '../spec_helper'

describe ConsadoleAggregator::Helper do
  describe :concatenate do
    context 'with argument 140 chars' do
      subject { ConsadoleAggregator::Helper.concat('い' * 140) }
      it { should have(140).item }
      it { should == 'い' * 140 }
    end
    context 'with argument 140 chars and 18 chars url' do
      subject { ConsadoleAggregator::Helper.concat('ろ' * 140, url:'http://example.jp/') }
      it { should have(140).item }
      it { should be_end_with 'ろ... http://example.jp/' }
    end
    context 'with argument 140 chars and 10 chars hashtag' do
      subject { ConsadoleAggregator::Helper.concat('は' * 140, hashtag:'#consadole') }
      it { should have(140).item }
      it { should be_end_with 'は... #consadole' }
    end
    context 'with argument 140 chars and 18 chars url and 10 chars hashtag' do
      subject { ConsadoleAggregator::Helper.concat('に' * 140, url:'http://example.jp/', hashtag:'#consadole') }
      it { should have(140).item }
      it { should be_end_with 'に... http://example.jp/ #consadole' }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
consadole_aggregator-0.1.9 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.8 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.7 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.6 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.5 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.4 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.3 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.2 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.1 spec/consadole_aggregator/helper_spec.rb
consadole_aggregator-0.1.0 spec/consadole_aggregator/helper_spec.rb