我最近改变了笔记本电脑,现在Rspec似乎没有在本地正常运行。 当我进行一个简单的测试时:
describe 'price' do
let(:product) { create(:product) }
let(:product_item) { create(:product_item, product_id: product.id) }
it "is half of the retail price if it has never been rented" do
product.update_attributes(sale_price_new: [200_000, 190_000])
product_item.reload
expect(product_item.price(2.days.from_now, "EUR")).to eq(100_000)
end
我得到了
Failures:
1) ProductItem price is half of the retail price if it has never been rented
Failure/Error: let(:product) { create(:product) }
RestClient::RequestTimeout:
Request Timeout
# ./spec/models/product_item_spec.rb:108:in `block (3 levels) in <top (required)>'
# ./spec/models/product_item_spec.rb:160:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:85:in `block (2 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# IO::EAGAINWaitReadable:
# Resource temporarily unavailable - read would block
# ./spec/models/product_item_spec.rb:108:in `block (3 levels) in <top (required)>'
但是当我在服务器或以前的笔记本电脑上运行它时,一切正常。 谁知道我错过了什么? 非常感谢!