Sha256: 702def0b448a0bb3dd1d5368653b4ad41edcb80923fe83eb93b3470907a79ae2

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

require "spec_helper"

describe Statesmin::Guard do
  let(:callback) { -> {} }
  let(:guard) { Statesmin::Guard.new(from: nil, to: nil, callback: callback) }

  specify { expect(guard).to be_a(Statesmin::Callback) }

  describe "#call" do
    subject(:call) { guard.call }

    context "success" do
      let(:callback) { -> { true } }
      specify { expect { call }.to_not raise_error }
    end

    context "error" do
      let(:callback) { -> { false } }
      specify { expect { call }.to raise_error(Statesmin::GuardFailedError) }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
statesmin-1.0.2 spec/statesmin/guard_spec.rb
statesmin-1.0.1 spec/statesmin/guard_spec.rb
statesmin-1.0.0 spec/statesmin/guard_spec.rb