Sha256: f7f4a43d0564a9d9bad1cf64c3c74637b24e4c15f5562ac05b73ffd8375899ec

Contents?: true

Size: 678 Bytes

Versions: 17

Compression:

Stored size: 678 Bytes

Contents

require "spec_helper"


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

  it "matches using regex" do
    condition = scorpion.new Shamu::Features::Conditions::Hosts, [ 'web\d+' ], toggle

    expect( context ).to receive( :host ).and_return "web3"
    expect( condition.match?( context ) ).to be_truthy
  end

  it "doesn't match using regex" do
    condition = scorpion.new Shamu::Features::Conditions::Hosts, [ 'web\d+-staging' ], toggle

    expect( context ).to receive( :host ).and_return "web3"
    expect( condition.match?( context ) ).to be_falsy
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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