Sha256: ce5306d7f81a00ac05ec7ae6f386268a3da94b924c2b82fd0cc7c02ab178fb9b

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

require 'spec_helper'

describe RailsEnv do
  it 'runs block when env matches' do
    block = proc {}
    expect(block).to receive(:call).with(Rails.configuration)
    Rails.env.on(:test, &block)
  end

  it 'matches against multiple envs' do
    block = proc {}
    expect(block).to receive(:call).with(Rails.configuration)
    Rails.env.on(:development, :test, &block)
  end

  it 'skips block when env differs' do
    block = proc {}
    expect(block).not_to receive(:call)
    Rails.env.on(:production, &block)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-env-0.2.0 spec/rails-env_spec.rb