Sha256: 08adb69473060c4e331cbbf2c537e4031e051f9657fd827c193a70aa385c1e27

Contents?: true

Size: 795 Bytes

Versions: 32

Compression:

Stored size: 795 Bytes

Contents

require_relative './helper'

class A; class B; class C; end; end; end

class TestClassFromString < Minitest::Test
  def test_empty_string
    assert_equal(nil, Fog::Vsphere.class_from_string(''))
  end

  def test_nil
    assert_equal(nil, Fog::Vsphere.class_from_string(nil))
  end

  def test_name_as_class
    assert_equal(A, Fog::Vsphere.class_from_string(A))
  end

  def test_name_as_string
    assert_equal(A, Fog::Vsphere.class_from_string('A'))
  end

  def test_unexpected_input
    assert_equal(nil, Fog::Vsphere.class_from_string(8))
  end

  def test_nested_class_without_default_path
    assert_equal(A::B::C, Fog::Vsphere.class_from_string(A::B::C))
  end

  def test_nested_class_with_default_path
    assert_equal(A::B::C, Fog::Vsphere.class_from_string('C', 'A::B'))
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fog-vsphere-1.12.0 tests/class_from_string_tests.rb
fog-vsphere-1.11.3 tests/class_from_string_tests.rb
fog-vsphere-1.11.2 tests/class_from_string_tests.rb
fog-vsphere-1.11.1 tests/class_from_string_tests.rb
fog-vsphere-1.11.0 tests/class_from_string_tests.rb
fog-vsphere-1.10.0 tests/class_from_string_tests.rb
fog-vsphere-1.9.2 tests/class_from_string_tests.rb
fog-vsphere-1.9.1 tests/class_from_string_tests.rb
fog-vsphere-1.9.0 tests/class_from_string_tests.rb
fog-vsphere-1.8.0 tests/class_from_string_tests.rb
fog-vsphere-1.7.1 tests/class_from_string_tests.rb
fog-vsphere-1.7.0 tests/class_from_string_tests.rb
fog-vsphere-1.6.0 tests/class_from_string_tests.rb
fog-vsphere-1.5.2 tests/class_from_string_tests.rb
fog-vsphere-1.5.1 tests/class_from_string_tests.rb
fog-vsphere-1.5.0 tests/class_from_string_tests.rb
fog-vsphere-1.4.0 tests/class_from_string_tests.rb
fog-vsphere-1.3.0 tests/class_from_string_tests.rb
fog-vsphere-1.2.2 tests/class_from_string_tests.rb
fog-vsphere-1.2.1 tests/class_from_string_tests.rb