Sha256: 49da4b2124a2b702b90e232385e72fa61dccf3de35b40da6cd1c619819001937

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 KB

Contents

ENV['RACK_ENV'] = 'test'
require_relative "../lib/raygun.rb"
require "minitest/autorun"
require "minitest/pride"
require "fakeweb"
require "timecop"
require "mocha/mini_test"

class NoApiKey < StandardError; end

class Raygun::IntegrationTest < Minitest::Unit::TestCase

  def setup
    Raygun.setup do |config|
      config.api_key = File.open(File.expand_path("~/.raygun4ruby-test-key"), "rb").read
      config.version = Raygun::VERSION
    end

  rescue Errno::ENOENT
    raise NoApiKey.new("Place a valid Raygun API key into ~/.raygun4ruby-test-key to run integration tests") unless api_key
  end

  def teardown
  end

end

class Raygun::UnitTest < MiniTest::Unit::TestCase

  def setup
    FakeWeb.allow_net_connect = false
    Raygun.configuration.api_key = "test api key"
  end

  def fake_successful_entry
    FakeWeb.register_uri(:post, "https://api.raygun.io/entries", body: "", status: 202)
  end

  def teardown
    FakeWeb.clean_registry
    FakeWeb.allow_net_connect = true
    reset_configuration
  end

  def reset_configuration
    Raygun.configuration = Raygun::Configuration.new
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
raygun4ruby-2.0.0 test/test_helper.rb
raygun4ruby-1.5.0 test/test_helper.rb
raygun4ruby-1.4.0 test/test_helper.rb
raygun4ruby-1.3.0 test/test_helper.rb
raygun4ruby-1.2.1 test/test_helper.rb
raygun4ruby-1.2.0 test/test_helper.rb
raygun4ruby-1.1.12 test/test_helper.rb
raygun4ruby-1.1.11 test/test_helper.rb
raygun4ruby-1.1.9 test/test_helper.rb
raygun4ruby-1.1.8 test/test_helper.rb
raygun4ruby-1.1.6 test/test_helper.rb
raygun4ruby-1.1.5 test/test_helper.rb