diff --git a/Tests/FindRuby/Rvm/RvmOnly.cmake b/Tests/FindRuby/Rvm/RvmOnly.cmake index 3851a7ccd4..86b32db250 100644 --- a/Tests/FindRuby/Rvm/RvmOnly.cmake +++ b/Tests/FindRuby/Rvm/RvmOnly.cmake @@ -21,21 +21,17 @@ endif() # Test: FindRuby.UnsetRvmOnly if (NOT RUBY_HOME) - # If ENV{MY_RUBY_HOME} isn't defined, it should default back to "STANDARD" - # At which point: + # If ENV{MY_RUBY_HOME} isn't defined and Ruby_FIND_VIRTUALENV is set to ONLY + # then Ruby should not be found - # It shouldn't find the RVM ruby find_package (Ruby ${RVM_RUBY_VERSION} EXACT QUIET) if(Ruby_FOUND) - message(FATAL_ERROR "Found RVM ruby when expecting system") + message (FATAL_ERROR "RVM Ruby unexpectedly found.") endif() - # it should find the system ruby + # it should *not* find the system ruby find_package (Ruby ${SYSTEM_RUBY_VERSION} EXACT QUIET) - if(NOT Ruby_FOUND) - message (FATAL_ERROR "Ruby not found.") - endif() - if (Ruby_FOUND MATCHES "^${RUBY_HOME}/.+") - message(FATAL_ERROR "Failed to find system ruby") + if(Ruby_FOUND) + message (FATAL_ERROR "Ruby unexpectedly found.") endif() endif()