Sha256: 1b520f1abc856cfe9898b4265014b7c24a175663b48e72e8517b6cfce65a827e

Contents?: true

Size: 1.44 KB

Versions: 15

Compression:

Stored size: 1.44 KB

Contents

# frozen_string_literal: true

require 'active_support'
require 'evostream/event'
require 'faker'
require 'json'
require 'webmock/rspec'
require 'capybara/rspec'
require 'active_support/core_ext/hash'

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

Dir['spec/support/**/*.rb'].each do |f|
  require File.expand_path(f)
end

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  # Disable all remote connections
  WebMock.disable_net_connect!(allow_localhost: true)

  # Exclude spec broken
  config.filter_run_excluding broken: true

  # Configure Service DSL
  config.before do
    Evostream::Service.configuration do |c|
      c.uri_in     = 'http://server_stream.local:80'
      c.uri_out    = 'http://server_stream.local:7777'
      c.name       = 'srteamming_'
      c.web_root   = '/var/www/html'
      c.model      = Test
      c.model_id   = :identifier_used_in_model
    end
  end

  # Configure test Net::HTTP
  config.before(:each, type: :request) do
    stub_request(:get, /server_stream.local/)
      .with(headers: { 'Accept': '*/*', 'User-Agent': 'Ruby' })
      .to_return(status: 200, body: '', headers: {})
  end

  config.before(:each, type: :response) do
    stub_request(:any, /server_stream.local/).to_rack(FakeEvostream)
  end
end

# Class for testing
class Test
  def self.find_by(id)
    id
  end
end

# Class for testing model stream
class Hls; end

# Class for testing model stream
class Dash; end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
evostream-event-1.0.0.pre.59 spec/spec_helper.rb
evostream-event-1.0.0.pre.58 spec/spec_helper.rb
evostream-event-0.3.2.pre.57 spec/spec_helper.rb
evostream-event-0.3.2.pre.56 spec/spec_helper.rb
evostream-event-0.3.2.pre.55 spec/spec_helper.rb
evostream-event-0.3.1 spec/spec_helper.rb
evostream-event-0.3.1.pre.53 spec/spec_helper.rb
evostream-event-0.3.1.pre.52 spec/spec_helper.rb
evostream-event-0.3.0 spec/spec_helper.rb
evostream-event-0.3.0.pre.48 spec/spec_helper.rb
evostream-event-0.2.7 spec/spec_helper.rb
evostream-event-0.2.7.pre.44 spec/spec_helper.rb
evostream-event-0.2.6 spec/spec_helper.rb
evostream-event-0.2.6.pre.41 spec/spec_helper.rb
evostream-event-0.2.6.pre.39 spec/spec_helper.rb