Sha256: 16ae3d9a02418135783c5f2def421e9b60e3a7264b2314b853ecbdc7f324d5c8

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'
require 'action_logic'

module ActionLogic
  describe ActionConfiguration do
    subject { described_class }

    before do
      described_class.reset!
    end

    context "benchmark" do
      it "defaults the benchmark configuration option to false" do
        expect(described_class.benchmark?).to be_falsey
      end

      it "returns true when the benchmark configuration option is set to true" do
        described_class.configure do |config|
          config.benchmark = true
        end

        expect(described_class.benchmark?).to be_truthy
      end
    end

    context "benchmark_log" do
      it "defaults benchmark log file to stdout" do
        expect(described_class.benchmark_log).to eq($stdout)
      end

      it "returns the log file when the benchmark log configuration option is set" do
        temp_file = Object.new

        described_class.configure do |config|
          config.benchmark_log = temp_file
        end

        expect(described_class.benchmark_log).to eq(temp_file)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
action_logic-0.2.2 spec/action_logic/action_configuration_spec.rb