@@ -46,21 +46,26 @@ def test_pkgconfig_with_option_returns_nil_on_error
4646 def test_pkgconfig_with_libs_option_returns_output
4747 pend ( "skipping because pkg-config is not installed" ) unless PKG_CONFIG
4848 expected = [ "-L#{ @fixtures_lib_dir } " , "-ltest1-public" ] . sort
49- actual = pkg_config ( "test1" , "libs" ) . shellsplit . sort
50- assert_equal ( expected , actual , MKMFLOG )
49+ actual = pkg_config ( "test1" , "libs" )
50+ assert_equal_sorted ( expected , actual , MKMFLOG )
5151 end
5252
5353 def test_pkgconfig_with_cflags_option_returns_output
5454 pend ( "skipping because pkg-config is not installed" ) unless PKG_CONFIG
5555 expected = [ "--cflags-other" , "-I#{ @fixtures_inc_dir } /cflags-I" ] . sort
56- actual = pkg_config ( "test1" , "cflags" ) . shellsplit . sort
57- assert_equal ( expected , actual , MKMFLOG )
56+ actual = pkg_config ( "test1" , "cflags" )
57+ assert_equal_sorted ( expected , actual , MKMFLOG )
5858 end
5959
6060 def test_pkgconfig_with_multiple_options
6161 pend ( "skipping because pkg-config is not installed" ) unless PKG_CONFIG
6262 expected = [ "-L#{ @fixtures_lib_dir } " , "-ltest1-public" , "-ltest1-private" ] . sort
63- actual = pkg_config ( "test1" , "libs" , "static" ) . shellsplit . sort
64- assert_equal ( expected , actual , MKMFLOG )
63+ actual = pkg_config ( "test1" , "libs" , "static" )
64+ assert_equal_sorted ( expected , actual , MKMFLOG )
65+ end
66+
67+ private def assert_equal_sorted ( expected , actual , msg = nil )
68+ actual = actual . shellsplit . sort if actual
69+ assert_equal ( expected , actual , msg )
6570 end
6671end
0 commit comments