Sha256: 6e9d62df0d33425b8e4fe9690409b61a7e41a8081ec0f3b233e2054ae35a660c

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 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

  it 'runs on any environment' do
    block = proc {}
    expect(block).to receive(:call).with(Rails.configuration)
    Rails.env.on(:any, &block)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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