美文网首页
使用xit暂停rspec单元测试

使用xit暂停rspec单元测试

作者: 春木橙云 | 来源:发表于2023-04-08 20:02 被阅读0次

写rubyOnRails采用测试先行,先写单元测试再写代码逻辑,这种方式太爽了,但是在写rspec单元测试的时候,如果某个单元测试没写完,暂停一下怎么搞?

require 'rails_helper'
require 'active_support/testing/time_helpers'
RSpec.describe "Users", type: :request do
  describe "查询用户" do
    xit "jwt过期" do
        // 测试内容
    end
  end
end

这样就会智能的在控制台提示你该处暂停,但是不会报错了。

相关文章

网友评论

      本文标题:使用xit暂停rspec单元测试

      本文链接:https://www.haomeiwen.com/subject/mfsvddtx.html