Sha256: 2a587a18dd53cfb6e33df1958ab6d8523a47228e3badee41ebde7ebdae7ca8ce

Contents?: true

Size: 905 Bytes

Versions: 1

Compression:

Stored size: 905 Bytes

Contents

# frozen_string_literal: true

require "webmock"

module Decidim
  module Suomifi
    module Test
      class Runtime
        # Ability to stub the requests already in the control class
        include WebMock::API

        def self.initializer(&block)
          @block = block
        end

        def self.initialize
          new.instance_initialize(&@block)
        end

        def self.load_app
          engine_spec_dir = File.join(Dir.pwd, "spec")

          require "#{Decidim::Dev.dummy_app_path}/config/environment"

          Dir["#{engine_spec_dir}/shared/**/*.rb"].each { |f| require f }

          require "paper_trail/frameworks/rspec"

          require "decidim/dev/test/spec_helper"
        end

        def self.cert_store
          @cert_store ||= CertStore.new
        end

        def instance_initialize
          yield self if block_given?
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-suomifi-0.19.0 lib/decidim/suomifi/test/runtime.rb