测试 minitest 安装问题

sunasit · 2017年09月14日 · 最后由 sunasit 回复于 2017年09月14日 · 6279 次阅读

咨询经验人士,关于在 rails 上安装 minitest 的问题,完全是按照官网手顺,想要使用 minitest 进行测试,但是 rake test 的时候,怎么也不出现下面的测试结果: Finished tests in 0.009262s, 107.9680 tests/s, 107.9680 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips

求指导,环境和配置等如下,还缺少什么配置吗????

环境: Jruby 1.9.6+ Rails 4.2.7.1+Postgres gemfile 包括:

em 'rails', '~> 5.1.4'
# Use jdbcsqlite3 as the database for Active Record
gem 'activerecord-jdbcsqlite3-adapter'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyrhino'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development


# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

测试对象:使用命令 rails generate scaffold article title:string body:text 自动生成的 model 文件,文件如下:

require 'test_helper'

class ArticleTest < ActiveSupport::TestCase
  test "the truth" do
    assert true
  end
end

test_helper.rb 如下,完全默认没有变更:

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
  fixtures :all

  # Add more helper methods to be used by all tests here...
end
sunasit 如何 让 MiniTest 的结果 高亮显示出来 提及了此话题。 09月14日 16:38

错误信息是什么?

Rei 回复

没有任何错误信息,在 article_test.rb 的 test 中 p 值,完全不进入。 测试用例根本没有运行起来

Rei 回复

有什么调查方向吗?

sunasit 回复

输入命令后什么信息也没有吗?

Rei 回复

是的。按照正常的思维来讲应该是极为简单的一个例子,但是团队的成员都是出现的同样的问题

sunasit 回复

现在在换 jruby 的版本,minitest 是 Jruby9 引入的,所以感觉上也是白换

需要 登录 后方可回复, 如果你还没有账号请 注册新账号