Sha256: 92562ede50ed1de7ef69216089791adae900834197f8d471ae3b0f568aeb1ecb

Contents?: true

Size: 962 Bytes

Versions: 55

Compression:

Stored size: 962 Bytes

Contents

require 'spec_helper'

describe Picky::Sinatra do

  let(:extendee) { Class.new {} }

  it 'has no Picky specific methods' do
    lambda { extendee.indexing }.should raise_error
  end
  it 'has no Picky specific methods' do
    lambda { extendee.searching }.should raise_error
  end

  context 'after extending' do
    before(:each) do
      extendee.extend Picky::Sinatra
    end
    it 'has Picky specific methods' do
      extendee.send :indexing, splits_text_on: /something/
    end
    it 'has Picky specific methods' do
      extendee.send :searching, splits_text_on: /something/
    end
    it 'gets forwardd correctly' do
      Picky::Tokenizer.should_receive(:default_indexing_with).once.with some: 'option'

      extendee.send :indexing, some: 'option'
    end
    it 'gets forwardd correctly' do
      Picky::Tokenizer.should_receive(:default_searching_with).once.with some: 'option'

      extendee.send :searching, some: 'option'
    end
  end

end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
picky-4.15.0 spec/lib/sinatra_spec.rb
picky-4.14.0 spec/lib/sinatra_spec.rb
picky-4.13.1 spec/lib/sinatra_spec.rb
picky-4.13.0 spec/lib/sinatra_spec.rb
picky-4.12.13 spec/lib/sinatra_spec.rb
picky-4.12.12 spec/lib/sinatra_spec.rb
picky-4.12.11 spec/lib/sinatra_spec.rb
picky-4.12.10 spec/lib/sinatra_spec.rb
picky-4.12.8 spec/lib/sinatra_spec.rb
picky-4.12.7 spec/lib/sinatra_spec.rb
picky-4.12.6 spec/lib/sinatra_spec.rb
picky-4.12.5 spec/lib/sinatra_spec.rb
picky-4.12.4 spec/lib/sinatra_spec.rb
picky-4.12.3 spec/lib/sinatra_spec.rb
picky-4.12.2 spec/lib/sinatra_spec.rb