Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not work with unit test #116

Open
yishilin opened this issue Jan 16, 2019 · 0 comments
Open

could not work with unit test #116

yishilin opened this issue Jan 16, 2019 · 0 comments

Comments

@yishilin
Copy link

yishilin commented Jan 16, 2019

First, It works in my ruby script, but it does not work in my unit test script:

test.rb:

require 'test/unit'

class SolutionTest < Test::Unit::TestCase 
  def test_case_1
    a = 12
    puts a.wrong
  end
end

Below is the output of the rescue command:

 ➜  rescue test.rb
Loaded suite /local/code/trie_tree/test
Started
E
====================================
/local/code/trie_tree/test.rb:7:in `test_case_1'
     4: 
     5:   def test_case_1
     6:     a = 12
  => 7:     puts a.wrong
     8:   end
     9: end
Error: test_case_1(SolutionTest): NoMethodError: undefined method `wrong' for 12:Integer
===================================

Finished in 0.002424 seconds.
-------------------------------
1 tests, 0 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
0% passed
--------------------------------
412.54 tests/s, 0.00 assertions/s


➜   ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

➜   rbenv versions
  system
* 2.5.3 (set by /Users/rick/.rbenv/version)

➜   gem list | grep test
minitest (5.10.3)
test-unit (3.2.7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant