Sha256: 3fd521a97f101758bc7511cd17f35b13362c5a4d83891768eb38ee88f9abc677

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

require 'spec_helper'
require 'busker'

describe Busker do
  it 'has a version' do
    expect(Busker::VERSION).to match(/\d+\.\d+\.\d+/)
  end
end

describe Busker::Busker do
  it 'can define a route via the initialize block' do
    busker = Busker::Busker.new do
      route '/path', :POST do
        'trallala'
      end
    end
    routes = busker.instance_variable_get('@_')[:routes]
    expect(routes).to be_a Hash
    expect(routes.size).to eql 1
    key, value = routes.first
    expect(key).to be_a Hash
    expect(key[:methods]).to eql ['POST']
    expect(key[:path]).to eql '/path'
    expect(key[:matcher]).to be_a Regexp
    expect(value).to be_a Hash
    expect(value[:opts]).to be_a Hash
    expect(value[:block]).to be_a Proc
  end

  # TODO: way more tests, including integration tests with capybara
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
busker-0.6.1 spec/lib/busker_spec.rb
busker-0.6.0 spec/lib/busker_spec.rb