Sha256: 9b59100feff8fdcd407f69ca3255939699d266a42545ad24b0951da54389ef03

Contents?: true

Size: 936 Bytes

Versions: 52

Compression:

Stored size: 936 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::Application.should_receive(:indexing).once.with some: 'option'
      
      extendee.send :indexing, some: 'option'
    end
    it 'gets delegated correctly' do
      Picky::Application.should_receive(:searching).once.with some: 'option'
      
      extendee.send :searching, some: 'option'
    end
  end
  
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
picky-4.0.0pre1 spec/lib/sinatra_spec.rb
picky-3.6.16 spec/lib/sinatra_spec.rb
picky-3.6.15 spec/lib/sinatra_spec.rb
picky-3.6.14 spec/lib/sinatra_spec.rb
picky-3.6.13 spec/lib/sinatra_spec.rb
picky-3.6.12 spec/lib/sinatra_spec.rb
picky-3.6.11 spec/lib/sinatra_spec.rb
picky-3.6.10 spec/lib/sinatra_spec.rb
picky-3.6.9 spec/lib/sinatra_spec.rb
picky-3.6.8 spec/lib/sinatra_spec.rb
picky-3.6.7 spec/lib/sinatra_spec.rb
picky-3.6.6 spec/lib/sinatra_spec.rb
picky-3.6.4 spec/lib/sinatra_spec.rb
picky-3.6.3 spec/lib/sinatra_spec.rb
picky-3.6.2 spec/lib/sinatra_spec.rb
picky-3.6.1 spec/lib/sinatra_spec.rb
picky-3.6.0 spec/lib/sinatra_spec.rb
picky-3.5.4 spec/lib/sinatra_spec.rb
picky-3.5.3 spec/lib/sinatra_spec.rb
picky-3.5.2 spec/lib/sinatra_spec.rb