- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我正在阅读 Michael Hartl 撰写的 Ruby on Rails 教程并继续阅读。然而,我在尝试进行一些测试时遇到了问题。
[fran@fran-desktop twitter-clone]$ bundle exec rake test
/media/Data.II/Dropbox/Web Development/odin-project/3. Ruby on Rails/twitter-clone/db/schema.rb doesn't exist yet. Run `rake db:migrate` to create it, then try again. If you do not intend to use a database, you should instead alter /media/Data.II/Dropbox/Web Development/odin-project/3. Ruby on Rails/twitter-clone/config/application.rb to limit the frameworks that will be loaded.
/home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- guard (LoadError)
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/gems/2.2.0/gems/guard-minitest-2.4.4/lib/minitest/guard_minitest_plugin.rb:4:in `<top (required)>'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:91:in `block in load_plugins'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `each'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `load_plugins'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:114:in `run'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:56:in `block in autorun'
我运行 rake db:migrate
(甚至认为我还没有创建任何迁移),现在错误如下:
[fran@fran-desktop twitter-clone]$ rake db:migrate
(1340.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
(0.1ms) select sqlite_version(*)
(143.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
[fran@fran-desktop twitter-clone]$ bundle exec rake test
(526.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
(0.2ms) select sqlite_version(*)
(243.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
(0.4ms) SELECT version FROM "schema_migrations"
(219.4ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
/home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- guard (LoadError)
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/gems/2.2.0/gems/guard-minitest-2.4.4/lib/minitest/guard_minitest_plugin.rb:4:in `<top (required)>'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/fran/.gem/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:91:in `block in load_plugins'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `each'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `load_plugins'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:114:in `run'
from /usr/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:56:in `block in autorun'
这是我的 gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
group :test do
gem 'minitest-reporters'
gem 'mini_backtrace'
gem 'guard-minitest'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
end
它会是什么?谢谢。
最佳答案
您正在使用 guard-minitest
gem,请查看 the Install section of its README 的第一行
即:
Please be sure to have Guard installed before you continue.
关于ruby-on-rails - Minitest 问题 Ruby on Rails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28685584/
我正在阅读 minitest 的模拟功能。 require "minitest/autorun" mock = MiniTest::Mock.new mock.expect(:use_any_stri
当我运行我的规范时,我得到这个错误,即使我从来没有在我的代码中的任何地方包含 minitest: Warning: you should require 'minitest/autorun' inst
我一直在使用 MiniTest 学习 TDD/BDD。我想弄清楚的是我的代码的哪些部分应该使用 MiniTest::Unit::TestCase 进行测试,哪些部分应该使用 MiniTest::Spe
请帮忙: 我想用 minitest 来使用 shoulda。 这是我得到的异常: NoMethodError: undefined method `run_teardown_hooks' for #:
请帮忙: 我想用 minitest 来使用 shoulda。 这是我得到的异常: NoMethodError: undefined method `run_teardown_hooks' for #:
我正在尝试启动并运行我的模型测试,但我的终端出现错误 rake aborted! uninitialized class variable @@current in MiniTest::Unit::T
考虑将 Minitest 用于现有的 Rails 3.2。 我试图了解 minitest-rails 和 minitest-spec-rails 之间的区别。 最佳答案 minitest-spec-r
我一直在使用 Ruby 2.1 附带的 MiniTest,没有任何问题。我将子类化 MiniTest::Unit:TestCase 创建几个方法,如“test_simple”,一切正常。我会毫无问题地
我正在使用 minitest 的规范语法和描述 block 。在我的 minitest_helper.rb (每个规范文件需要)中,我有: Minitest::Test.i_suck_and_my_t
我正在使用 minitest 的规范语法和描述 block 。在我的 minitest_helper.rb (每个规范文件需要)中,我有: Minitest::Test.i_suck_and_my_t
在 Ruby 1.9.1 中,我发现 ctrl + c 只会杀死一个单元测试,而你无法停止整个测试程序的运行方式。 相比之下,在 Ruby 1.8 中的 test/unit 下,它会停止所有测试。 1
我有一个方法“退出”: def quit puts "Good bye!" exit end 我想做的是做一个小型测试断言 quit 方法确实退出了,但我尝试过的都不起作用。寻找输入。提前致谢
我正在尝试在我的代码中测试该方法,但第二个测试返回错误 undefined local variable or method 'params' 测试方法的正确方法是什么?还是我需要对 main.rb
Ruby 1.9 有很棒的 Unicode 支持,是吗? # encoding: utf-8 require 'minitest/spec' require 'minitest/autorun' de
我使用 minitest 为我的网络项目编写测试。 我有一个模拟对象,模拟了 3 个方法。该对象表示具有多个属性的数据库实体(hanami 模型)。现在,如果我多次为一个属性调用“getter”,我会
我在我的迷你测试中使用自定义断言,我想对我的断言进行单元测试。当然,我可以测试快乐路径,但我想断言测试实际上失败了。 module Minitest module Assertions d
我正在查看我的测试用例结果,很难看出我的测试中的一个小故障是从哪里来的。 我正在处理合理大小的数据结构 - 我不想更改 to_s 方法,以便它对 minitest diff 稍微好一些。 我看过记者,
是否有用于 minitest 的替代测试报告器,它会在测试运行时显示哪些测试已损坏以及错误消息是什么,而不必等到结束。 最佳答案 你可以看看 minitest-reporters gem 。它允许您以
(已在 https://www.ruby-forum.com/topic/6876320 发布,但在这里交叉发布,因为到目前为止我还没有收到回复)。 关于在 Minitest 和/或 Test::Un
每当我尝试 assert_equal 两个对象时,我总是会遇到这样的错误: No visible difference in the User#inspect output. You sh
我是一名优秀的程序员,十分优秀!