Sha256: f01032ddf276540be1b594980554fda82ea2171a19f4a1de0f0139df98d5f406

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

require 'spec_helper'

class Container
  include Controll::Event::Helper  
end

describe Controll::Event::Helper do
  subject { Container.new }

  let(:events)      { %w{sign_in sign_out} }
  let(:bad_events)  { %w{bad stuff} }

  let(:event)       { 'sign_in' }
  let(:bad_event)   { 'unknown' }

  describe '.normalize event' do
    context 'Controll::Event' do
      specify { subject.normalize(Controll::Event.new(:x)).should be_a Controll::Event  }
    end

    context 'Symbol' do
      specify { subject.normalize(:x).should be_a Controll::Event  }
    end

    context 'Hash' do
      specify { subject.normalize(:name => :y).should be_a Controll::Event  }
    end    
  end

  describe '.create_event' do
    specify { subject.create_event(:x).should be_a Controll::Event }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
controll-0.3.2 spec/controll/event/helper_spec.rb
controll-0.3.1 spec/controll/event/helper_spec.rb
controll-0.3.0 spec/controll/event/helper_spec.rb