Menu

#5 rake install fails on OS X 10.12

v1.0 (example)
open
nobody
None
5
2016-10-23
2016-10-21
No

Following the installation instructions, I have installed the rake gem, and tried to install FRUIT. Unfortunately, it fails with the message below. Running Ruby 2.0.

$ rake install
"rubygems/package_task"
ruby fruit_processor_test.rb
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
From:
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/test/unit.rb:3:in `<top (required)>'
  fruit_processor_test.rb:1:in `<main>'
MiniTest::Unit::TestCase is now Minitest::Test. From /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/test/unit/testcase.rb:8:in `<module:Unit>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/test/unit.rb:670:in `<class:Runner>': undefined method `_run_suite' for class `Test::Unit::Runner' (NameError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/test/unit.rb:255:in `<module:Unit>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/test/unit.rb:9:in `<module:Test>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/test/unit.rb:8:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from fruit_processor_test.rb:1:in `<main>'
rake aborted!
Command failed with status (1): [ruby fruit_processor_test.rb...]
/Users/fonnescj/Repositories/fruit_3.4.1/fruit_processor_gem/rakefile:75:in `block (2 levels) in <top (required)>'
/Users/fonnescj/Repositories/fruit_3.4.1/fruit_processor_gem/rakefile:74:in `chdir'
/Users/fonnescj/Repositories/fruit_3.4.1/fruit_processor_gem/rakefile:74:in `block in <top (required)>'
Tasks: TOP => install => default => test
(See full trace by running task with --trace)

Discussion

  • istomoya

    istomoya - 2016-10-22

    Could you see if

    $ cd fruit_processor_gem/test
    $ ruby fruit_processor_test.rb
    

    works?
    In my environment,

    MacBook:fruit_3.4.1 istomoya$ sw_vers
    ProductName:    Mac OS X
    ProductVersion: 10.12
    BuildVersion:   16A323
    MacBook:fruit_3.4.1 istomoya$ ruby --version
    ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
    MacBook:fruit_3.4.1 istomoya$ cd fruit_processor_gem/test/
    MacBook:test istomoya$ ruby fruit_processor_test.rb 
    Run options: 
    
    # Running tests:
    
    [10/27] FruitProcessorTest#test_fruit_picker__timestamp2016-10-23 08:35:36 +0900
    [25/27] FruitProcessorTest#test_set_process_onlyWarning: _test.f?? in filename must be lower case while in_subdir2_TEST.F03 has upper case
    Finished tests in 4.146009s, 6.5123 tests/s, 34.2498 assertions/s.              
    27 tests, 142 assertions, 0 failures, 0 errors, 0 skips
    
    ruby -v: ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
    MacBook:test istomoya$ 
    

    For now I can't help you much as I've just installed macOS Sierra and still setting up develop environment.

     
  • istomoya

    istomoya - 2016-10-23

    Seemingly it's related to version of minitest.
    After updating minitest from 4.3.2 to 5.9.1 by [ sudo gem install minitest ],
    I began to have similar error "MiniTest::Unit::TestCase is now Minitest::Test. ..."

    For latest minitest, fruit_processor_test.rb needs some modification.
    Replace

    require 'test/unit'
    

    with

    require 'minitest/autorun'
    require 'minitest/unit'
    

    Replace twice

    class (something) < Test::Unit::TestCase
    

    with

     class (something) < Minitest::Test
    

    Replace "assert_raise" with "assert_raises"
    Whole "assert_noting_raised( ... )" must be commented out.

    --- a/myfruit/fruit_processor_gem/test/fruit_processor_test.rb
    +++ b/myfruit/fruit_processor_gem/test/fruit_processor_test.rb
    @@ -1,8 +1,9 @@
    -require 'test/unit'
    +require 'minitest/autorun'  #<- added oct_2016
    +require 'minitest/unit'  #<- added oct_2016
     require '../lib/fruit_processor'
     require 'pathname'
    
    -class FruitProcessorTest < Test::Unit::TestCase
    +class FruitProcessorTest < Minitest::Test
       @@driver     = "fruit_driver_gen.f90"
       @@driver_mpi = "fruit_driver_mpi_gen.f90"
       @@basket     = "fruit_basket_gen.f90"
    @@ -313,18 +314,18 @@ class FruitProcessorTest < Test::Unit::TestCase
    
       def test_set_process_only
         fp = FruitProcessor.new
    -    assert_raise(RuntimeError, message = "raise if files set to process_only are not *_test.f??"){
    +    assert_raises(RuntimeError, message = "raise if files set to process_only are not *_test.f??"){
           fp.process_only = ["in_subdir_test.f90", "in_subdir2_test.f03", "not_tester.f90"]
         }
    -    assert_nothing_raised("no raise if files set to process_only are *_test.f??"){
    -      fp.process_only = ["in_subdir_test.f90", "in_subdir2_TEST.F03", "xxx_test.f08"]
    -    }
    +    # assert_nothing_raised("no raise if files set to process_only are *_test.f??"){
    +    #   fp.process_only = ["in_subdir_test.f90", "in_subdir2_TEST.F03", "xxx_test.f08"]
    +    # }
       end
    
       def test_process_only__absent
         fp = FruitProcessor.new
         fp.process_only = ["in_subdir_test.f90", "in_subdir2_test.f90", "not_existing_test.f90"]
    -    assert_raise(RuntimeError, message = "absent file cause exception"){
    +    assert_raises(RuntimeError, message = "absent file cause exception"){
           fp.load_files(["subdir/", "subdir2", "subdir2/"])
         }
       end
    @@ -606,7 +607,7 @@ class FruitProcessorTest < Test::Unit::TestCase
    
     end
    
    -class FruitFortranFileTest < Test::Unit::TestCase
    +class  FruitFortranFileTest < Minitest::Test
       def test_read_noarg_sub_name
         fortran_code = "fortran_cont_and_comment.f90"
         if (File.exist?(fortran_code))
    
     
  • Christopher Fonnesbeck

    Thanks for the prompt reply. I can confirm that the changes above fix the test.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.