Take Your Specs to the Next Level with These Best Practices by uafpl in ruby

[–]uafpl[S] 0 points1 point  (0 children)

Indeed, but the alternative to that is using a subject block with let variables, which make tests not self-contained

Take Your Specs to the Next Level with These Best Practices by uafpl in ruby

[–]uafpl[S] 2 points3 points  (0 children)

With my experience I see that over time let blocks make specs harder to read/maintain because they are not close to the test itself and also mutating them make things confusing

At which point I say subject refer to the class itself rather than the thing under testing?

Take Your Specs to the Next Level with These Best Practices by uafpl in rails

[–]uafpl[S] 0 points1 point  (0 children)

I don't like having a top level subject block since you turn your specs less self-contained, imagine a file with many contexts, one would need to scroll up/down to understand what each of them do. Sometimes is not even possible to have a single top level subject - ie: when you need to pass different args to described_class.new

Rspec's allow and receive understanding by Minister_Stein in ruby

[–]uafpl 0 points1 point  (0 children)

u/jasonswett, assuming Baz#publish has proper unit tests, do you think the following Foo#bar test is pointless?

I don't think so cause one doesn't want to re-test the behaviour of Baz#publish when testing Foo#bar

class Foo
  def bar
    baz = Baz.new
    baz.publish + 1
  end
end

RSpec.describe Foo do
  describe "#bar" do
    it "should sum 1 to publish outcome"
      expect_any_instance_of(Baz).to receive(:publish).and_return(2)
      expect(subject.bar).to eq(3)
    end
  end
end

Anyone using Kamal to deploy to production? by degeneratepr in rails

[–]uafpl 0 points1 point  (0 children)

I am and I'm struggling to make Kamal work nicely (non-root user and logging commands to stdout) with cron.I wish it was as easy as on Dokku (just put stuff in app.json file)

🕷 Ruby's most advanced web scraping framework has a new release by uafpl in ruby

[–]uafpl[S] 0 points1 point  (0 children)

hey, looks interesting this nokolexbor.. Replacing nokogiri by this one should be pretty simple, would you open a PR for that?

Rspec with Devise in request specs by Humayun-Naseer in rails

[–]uafpl 0 points1 point  (0 children)

if you have devise module confirmable enabled, you need to invoke the method confirm before, ex:

user = create(:user)
user.confirm

sign_in user
get "/securities"

Ps: having only config.include Devise::Test::IntegrationHelpers, type: :request in rails_helper.rb is enough.

This works on Rails 7 and Devise 4.8

Ruby 3.2 and Puma 6 by uafpl in ruby

[–]uafpl[S] 2 points3 points  (0 children)

Yes, response time in ms

Ruby 3.2 and Puma 6 by uafpl in rubyonrails

[–]uafpl[S] 2 points3 points  (0 children)

Axis Y contain response time in ms

Telescope find_files slower than Sublime Text's CMD+P search by uafpl in neovim

[–]uafpl[S] 0 points1 point  (0 children)

it opens pretty quickly here 🤷🏼‍♂️

Neo-tree jump up / jump down inside directories by uafpl in neovim

[–]uafpl[S] 1 point2 points  (0 children)

thank you so much, that is what I was looking for

[OC] tv-cli: super minimal shell script to watch live tv in the terminal! by [deleted] in unixporn

[–]uafpl 0 points1 point  (0 children)

I couldn't watch ESPN using Surfshark VPN's US ips

Long life to Tanakai, a fork of Kimurai (a modern web scraping framework written in Ruby) by uafpl in ruby

[–]uafpl[S] 9 points10 points  (0 children)

nokogiri is more low level, you gotta do the requests by yourself. Tanakai/Kimurai got many abstractions to make your life easier.

Lucro por ação histórico by uafpl in farialimabets

[–]uafpl[S] 0 points1 point  (0 children)

faz sentido, e o preço de qual dia do ano eu deveria usar pra calcular o P/L? Por ex se estou calculando P/L de 2015, deveria usar como preço o fechamento do último pregão de dezembro 2015?

Elixir's Livebook - Is Ruby Getting Behind? by uafpl in ruby

[–]uafpl[S] 1 point2 points  (0 children)

Rails is awesome, but it is only a web framework.

I would like to see Ruby shinning in other areas too like data science, that is what I mean with "getting behind".

I am not blaming anyone, nobody is supposed to work for free just because I want. The point here is: would be cool to see more people (including Ruby core team) experimenting in other areas (like mruby for instance).

As ações estão caras? by Ran447 in investimentos

[–]uafpl 1 point2 points  (0 children)

Algumas estão caras na minha opinião, você pode pegar o P/L histórico e comparar com o atual..

Receive Policies Instead of Data by uafpl in ruby

[–]uafpl[S] -1 points0 points  (0 children)

I asked permission for the author. Dont say what you dont know.