Sha256: fa614195e3f209a2be80228fe7e15465ae8eabbba5f9167be055b9e3299ce049

Contents?: true

Size: 551 Bytes

Versions: 3

Compression:

Stored size: 551 Bytes

Contents

require 'spec_helper'

describe Controll::Event::Matcher do
  subject { Controll::Event::Matcher.new event }

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

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

  describe '.initialize event' do
    its(:event) { should be_a Controll::Event }
    its('event.name') { should == :sign_in }
  end

  describe '.match? events' do
    specify { subject.match?(events).should be_true }

    specify { subject.match?(bad_events).should be_false }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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