Sha256: cc69ee6e9d4dfb38ec619f2a3ee0c6221f27f21c2c6c6cf17f824269c4b93ef1

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

module SpecInfra
  module Helper
    module Configuration
      def subject
        example.metadata[:subject] = described_class
        build_configurations
        super
      end

      # You can create a set of configurations provided to all specs in your spec_helper:
      #
      #   RSpec.configure { |c| c.pre_command = "source ~/.zshrc" }
      #
      # Any configurations you provide with `let(:option_name)` in a spec will
      # automatically be merged on top of the configurations.
      #
      # @example
      #
      #   describe 'Gem' do
      #     let(:pre_command) { "source ~/.zshrc" }
      #
      #     %w(pry awesome_print bundler).each do |p|
      #       describe package(p) do
      #         it { should be_installed.by('gem') }
      #       end
      #     end
      #   end
      def build_configurations
        SpecInfra::Configuration.defaults.keys.each do |c|
          value = self.respond_to?(c.to_sym) ?
          self.send(c) : RSpec.configuration.send(c)
          SpecInfra::Configuration.send(:"#{c}=", value)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
specinfra-0.0.3 lib/specinfra/helper/configuration.rb
specinfra-0.0.2 lib/specinfra/helper/configuration.rb