Sha256: 997b273a054f31ee404eac2f0234a2858516a922c341426636f00c3ec72c87e3

Contents?: true

Size: 938 Bytes

Versions: 42

Compression:

Stored size: 938 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, some: 'option'
    end
    it 'has Picky specific methods' do
      extendee.send :searching, some: 'option'
    end
    it 'gets delegated correctly' do
      Picky::Tokenizer.should_receive(:default_indexing_with).once.with some: 'option'

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

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

end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
picky-4.6.3 spec/lib/sinatra_spec.rb
picky-4.6.2 spec/lib/sinatra_spec.rb
picky-4.6.1 spec/lib/sinatra_spec.rb
picky-4.6.0 spec/lib/sinatra_spec.rb
picky-4.5.12 spec/lib/sinatra_spec.rb
picky-4.5.11 spec/lib/sinatra_spec.rb
picky-4.5.10 spec/lib/sinatra_spec.rb
picky-4.5.9 spec/lib/sinatra_spec.rb
picky-4.5.8 spec/lib/sinatra_spec.rb
picky-4.5.7 spec/lib/sinatra_spec.rb
picky-4.5.6 spec/lib/sinatra_spec.rb
picky-4.5.5 spec/lib/sinatra_spec.rb
picky-4.5.4 spec/lib/sinatra_spec.rb
picky-4.5.3 spec/lib/sinatra_spec.rb
picky-4.5.2 spec/lib/sinatra_spec.rb
picky-4.5.1 spec/lib/sinatra_spec.rb
picky-4.5.0 spec/lib/sinatra_spec.rb
picky-4.4.2 spec/lib/sinatra_spec.rb
picky-4.4.1 spec/lib/sinatra_spec.rb
picky-4.4.0 spec/lib/sinatra_spec.rb