Sha256: 1290c9e3c687ea1853a9f98f28d70168648e132e0669d753ca515881f7fff5d2

Contents?: true

Size: 682 Bytes

Versions: 6

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

module Rubysmith
  module Builders
    module RSpec
      # Builds RSpec shared context for temporary directories.
      class Context
        def self.call realm, builder: Builder
          new(realm, builder: builder).call
        end

        def initialize realm, builder: Builder
          @realm = realm
          @builder = builder
        end

        def call
          return unless realm.build_rspec

          builder.call(
            realm.with(template_path: "%project_name%/spec/support/shared_contexts/temp_dir.rb.erb")
          ).render
        end

        private

        attr_reader :realm, :builder
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-0.5.0 lib/rubysmith/builders/rspec/context.rb
rubysmith-0.4.0 lib/rubysmith/builders/rspec/context.rb
rubysmith-0.3.0 lib/rubysmith/builders/rspec/context.rb
rubysmith-0.2.0 lib/rubysmith/builders/rspec/context.rb
rubysmith-0.1.1 lib/rubysmith/builders/rspec/context.rb
rubysmith-0.1.0 lib/rubysmith/builders/rspec/context.rb