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.3.2 spec/lib/sinatra_spec.rb
picky-4.3.1 spec/lib/sinatra_spec.rb
picky-4.3.0 spec/lib/sinatra_spec.rb
picky-4.2.4 spec/lib/sinatra_spec.rb
picky-4.2.3 spec/lib/sinatra_spec.rb
picky-4.2.2 spec/lib/sinatra_spec.rb
picky-4.2.1 spec/lib/sinatra_spec.rb
picky-4.2.0 spec/lib/sinatra_spec.rb
picky-4.1.0 spec/lib/sinatra_spec.rb
picky-4.0.9 spec/lib/sinatra_spec.rb
picky-4.0.8 spec/lib/sinatra_spec.rb
picky-4.0.7 spec/lib/sinatra_spec.rb
picky-4.0.6 spec/lib/sinatra_spec.rb
picky-4.0.5 spec/lib/sinatra_spec.rb
picky-4.0.4 spec/lib/sinatra_spec.rb
picky-4.0.3 spec/lib/sinatra_spec.rb
picky-4.0.1 spec/lib/sinatra_spec.rb
picky-4.0.0 spec/lib/sinatra_spec.rb
picky-4.0.0pre6 spec/lib/sinatra_spec.rb
picky-4.0.0pre5 spec/lib/sinatra_spec.rb