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.31.3 spec/lib/sinatra_spec.rb
picky-4.31.2 spec/lib/sinatra_spec.rb
picky-4.31.1 spec/lib/sinatra_spec.rb
picky-4.31.0 spec/lib/sinatra_spec.rb
picky-4.30.0 spec/lib/sinatra_spec.rb
picky-4.29.0 spec/lib/sinatra_spec.rb
picky-4.28.1 spec/lib/sinatra_spec.rb
picky-4.27.1 spec/lib/sinatra_spec.rb
picky-4.27.0 spec/lib/sinatra_spec.rb
picky-4.26.2 spec/lib/sinatra_spec.rb
picky-4.26.1 spec/lib/sinatra_spec.rb
picky-4.26.0 spec/lib/sinatra_spec.rb
picky-4.25.3 spec/lib/sinatra_spec.rb
picky-4.25.2 spec/lib/sinatra_spec.rb
picky-4.25.1 spec/lib/sinatra_spec.rb
picky-4.25.0 spec/lib/sinatra_spec.rb
picky-4.24.0 spec/lib/sinatra_spec.rb
picky-4.23.2 spec/lib/sinatra_spec.rb
picky-4.23.1 spec/lib/sinatra_spec.rb
picky-4.23.0 spec/lib/sinatra_spec.rb