From 3a666a7f8f80112e6b87b9766474396988c03d0b Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 17 Jan 2024 15:32:02 -0500 Subject: [PATCH] They moved the sell price column --- lib/btc_sell_prices.rb | 2 +- test/test_btc_sell_prices.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/btc_sell_prices.rb b/lib/btc_sell_prices.rb index f26fb99371f405be0776ebedefae5bd681ce3d46..f1783db28f2d7b52375a4e30de5b4d31b8fd03c6 100644 --- a/lib/btc_sell_prices.rb +++ b/lib/btc_sell_prices.rb @@ -27,7 +27,7 @@ class BTCSellPrices end BigDecimal( - bitcoin_row.at("td:nth-of-type(3)").text.match(/^\$(\d+\.\d+)/)[1] + bitcoin_row.at("td:nth-of-type(4)").text.match(/^\$(\d+\.\d+)/)[1] ) end end diff --git a/test/test_btc_sell_prices.rb b/test/test_btc_sell_prices.rb index 5ba66e6813f240d489bc83f32766ee67959d9a6f..584a5737c101d63065568790dae0cf236f321900 100644 --- a/test/test_btc_sell_prices.rb +++ b/test/test_btc_sell_prices.rb @@ -13,7 +13,7 @@ class BTCSellPricesTest < Minitest::Test def test_cad stub_request(:get, "https://www.canadianbitcoins.com").to_return( body: "
" \ - "" + "" ) assert_equal BigDecimal(123), @subject.cad.sync end @@ -22,7 +22,7 @@ class BTCSellPricesTest < Minitest::Test def test_usd stub_request(:get, "https://www.canadianbitcoins.com").to_return( body: "
Bitcoin$123.00Bitcoin$123.00
" \ - "" + "" ) @redis.expect(:get, EMPromise.resolve("0.5"), ["cad_to_usd"]) assert_equal BigDecimal(123) / 2, @subject.usd.sync
Bitcoin$123.00Bitcoin$123.00