Sha256: 0b65cbc239e038e8f32bb8c01cf6ec1fb134707f328cad360f235c03f7e85644

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 }

    after 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.3 spec/action_logic/action_configuration_spec.rb