Sha256: 74efb6098d10d64ea3bb9ecf4a0c69e38dbd865ce7b21a58f8546f35cd99f4de

Contents?: true

Size: 1.04 KB

Versions: 11

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require 'test_helper'
require 'integration_test_helpers'
require 'integration_test'
require 'yaml'

class TestIntegration < Minitest::Test
  IntegrationTestHelpers.find_integration_tests.map do |test_file|
    tests = YAML.load(File.read(test_file))['tests']

    tests.each do |test|
      define_method(:"test_#{test['name']}") do
        it = IntegrationTest.new(test)

        case it.test_type
        when :raise
          err = assert_raises(it.expected[:error]) do
            it.test_client.send(it.func, *it.input)
          end
          assert_match(/#{it.expected[:message]}/, err.message)
        when :nil
          assert_nil it.test_client.send(it.func, *it.input)
        when :feature_flag
          flag, lookup_key, attributes = *it.input
          assert_equal it.expected[:value], it.test_client.send(it.func, flag, lookup_key, attributes: attributes)
        when :simple_equality
          assert_equal it.expected[:value], it.test_client.send(it.func, *it.input)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
prefab-cloud-ruby-0.23.8 test/test_integration.rb
prefab-cloud-ruby-0.23.7 test/test_integration.rb
prefab-cloud-ruby-0.23.6 test/test_integration.rb
prefab-cloud-ruby-0.23.5 test/test_integration.rb
prefab-cloud-ruby-0.23.4 test/test_integration.rb
prefab-cloud-ruby-0.23.3 test/test_integration.rb
prefab-cloud-ruby-0.23.2 test/test_integration.rb
prefab-cloud-ruby-0.23.1 test/test_integration.rb
prefab-cloud-ruby-0.23.0 test/test_integration.rb
prefab-cloud-ruby-0.22.0 test/test_integration.rb
prefab-cloud-ruby-0.21.0 test/test_integration.rb