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-3.5.1 spec/lib/sinatra_spec.rb
picky-3.5.0 spec/lib/sinatra_spec.rb
picky-3.4.3 spec/lib/sinatra_spec.rb
picky-3.4.2 spec/lib/sinatra_spec.rb
picky-3.4.1 spec/lib/sinatra_spec.rb
picky-3.4.0 spec/lib/sinatra_spec.rb
picky-3.3.3 spec/lib/sinatra_spec.rb
picky-3.3.2 spec/lib/sinatra_spec.rb
picky-3.3.1 spec/lib/sinatra_spec.rb
picky-3.3.0 spec/lib/sinatra_spec.rb
picky-3.2.0 spec/lib/sinatra_spec.rb
picky-3.1.13 spec/lib/sinatra_spec.rb
picky-3.1.12 spec/lib/sinatra_spec.rb
picky-3.1.11 spec/lib/sinatra_spec.rb
picky-3.1.10 spec/lib/sinatra_spec.rb
picky-3.1.9 spec/lib/sinatra_spec.rb
picky-3.1.8 spec/lib/sinatra_spec.rb
picky-3.1.7 spec/lib/sinatra_spec.rb
picky-3.1.6 spec/lib/sinatra_spec.rb
picky-3.1.5 spec/lib/sinatra_spec.rb