1
我有錯誤消息./spec/models/lib/parsers/s_reality_cz/matcher_spec.rb:12:in'block(2 levels )in'在每個rspec測試中。我做錯了什麼?使用rspec-rails 3.5。由於ruby rspec in <top(required)>'block(2 levels)''
代碼: 需要 'rails_helper'
RSpec.describe Parsers::SRealityCz::Matcher, :type=> :model do
before do
@doc = File.open("spec/fixtures/srealitycz_profile.html") { |f| Nokogiri::HTML(f) }
end
let(:parser) { described_class }
it "returns total price" do
expect(parser.title(@doc)).to eq "Prodej bytu 1+kk 40 m²"
end
end
Rspec的輸出:
Randomized with seed 37464
expected: "Prodej bytu 1+kk 40 m²"
got: "Prodej bytu 1+kk 40 m²"
(compared using ==)
./spec/models/lib/parsers/s_reality_cz/matcher_spec.rb:12:in `block (2 levels) in <top (required)>'
-e:1:in `load'
-e:1:in `<main>'
1 example, 1 failure, 0 passed
Finished in 0.139173354 seconds
多麼容易:)謝謝你 – Matho