Sha256: a3b986d51b5734a2e95ac494dfe162170ae4beecfc377602ba563b3dca5ccb39

Contents?: true

Size: 763 Bytes

Versions: 17

Compression:

Stored size: 763 Bytes

Contents

require "spec_helper"

module ProcSpec
  class CustomProc
    def match?( context )
    end
  end
end

describe Shamu::Features::Conditions::Proc do
  let( :context ) { double( Shamu::Features::Context ) }
  let( :toggle )  { double( Shamu::Features::Toggle ) }

  it "invokes the specified match method" do
    expect( context ).to receive( :scorpion ).and_return scorpion

    condition = scorpion.new Shamu::Features::Conditions::Proc, "ProcSpec::CustomProc#match?", toggle

    instance = condition.send( :instance, context )
    expect( condition ).to receive( :instance ).and_return instance

    expect( instance ).to be_a ProcSpec::CustomProc
    expect( instance ).to receive( :match? ).with( context, toggle )

    condition.match?( context )
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shamu-0.0.24 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.21 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.20 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.19 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.18 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.17 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.15 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.14 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.13 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.11 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.9 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.8 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.7 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.5 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.4 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.3 spec/lib/shamu/features/conditions/proc_spec.rb
shamu-0.0.2 spec/lib/shamu/features/conditions/proc_spec.rb