Sha256: 653b8b33dddbe94559ed2ff06d2b76f8b0cdfbf113a3020eb0c47653f458ad94

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 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|
          if self.respond_to?(c.to_sym)
            value = self.send(c)
          else
            value = RSpec.configuration.send(c) if defined?(RSpec)
          end
          SpecInfra::Configuration.instance_variable_set("@#{c}", value)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
specinfra-0.1.1 lib/specinfra/helper/configuration.rb
specinfra-0.1.0 lib/specinfra/helper/configuration.rb
specinfra-0.0.17 lib/specinfra/helper/configuration.rb
specinfra-0.0.16 lib/specinfra/helper/configuration.rb
specinfra-0.0.15 lib/specinfra/helper/configuration.rb
specinfra-0.0.14 lib/specinfra/helper/configuration.rb
specinfra-0.0.13 lib/specinfra/helper/configuration.rb
specinfra-0.0.12 lib/specinfra/helper/configuration.rb
specinfra-0.0.11 lib/specinfra/helper/configuration.rb
specinfra-0.0.10 lib/specinfra/helper/configuration.rb
specinfra-0.0.9 lib/specinfra/helper/configuration.rb
specinfra-0.0.8 lib/specinfra/helper/configuration.rb
specinfra-0.0.7 lib/specinfra/helper/configuration.rb
specinfra-0.0.6 lib/specinfra/helper/configuration.rb
specinfra-0.0.5 lib/specinfra/helper/configuration.rb
specinfra-0.0.4 lib/specinfra/helper/configuration.rb