Sha256: b6765d9f4114e2d5f2b95ecfd583c9bd0209871561fab06ca9d3dff4dfaf2a2c

Contents?: true

Size: 774 Bytes

Versions: 19

Compression:

Stored size: 774 Bytes

Contents

require_relative './helper'

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

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

  def test_nil
    assert_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_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

19 entries across 17 versions & 2 rubygems

Version Path
fog-vsphere-3.7.0 tests/class_from_string_tests.rb
fog-vsphere-3.6.8 tests/class_from_string_tests.rb
fog-vsphere-3.6.7 tests/class_from_string_tests.rb
fog-vsphere-3.6.6 tests/class_from_string_tests.rb
fog-vsphere-3.0.0 tests/class_from_string_tests.rb
fog-vsphere-2.5.0 tests/class_from_string_tests.rb
fog-vsphere-2.4.0 tests/class_from_string_tests.rb
fog-vsphere-2.3.0 tests/class_from_string_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-vsphere-2.2.0/tests/class_from_string_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-vsphere-2.2.0/tests/class_from_string_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-vsphere-2.2.0/tests/class_from_string_tests.rb
fog-vsphere-2.2.0 tests/class_from_string_tests.rb
fog-vsphere-1.7.0.1 tests/class_from_string_tests.rb
fog-vsphere-2.1.1 tests/class_from_string_tests.rb
fog-vsphere-2.1.0 tests/class_from_string_tests.rb
fog-vsphere-2.0.1 tests/class_from_string_tests.rb
fog-vsphere-2.0.0 tests/class_from_string_tests.rb
fog-vsphere-1.13.1 tests/class_from_string_tests.rb
fog-vsphere-1.13.0 tests/class_from_string_tests.rb