録画協力枠とは、当日の講演の様子を録画して動画ファイルを共有してもらえる方が申込み可能な参加枠です。
運営チームでは登壇の撮影を行う余裕がないため、参加者の方にお手伝いいただきたいです🙏
ppメソッドでJSON.parse(response.body)
の中身を確認してみました。
require 'rails_helper'
describe 'Projects API', type: :request do
it 'loads a project' do
user = FactoryBot.create(:user)
FactoryBot.create(:project, name: "Sample Project")
FactoryBot.create(:project, name: "Second Sample Project", owner: user)
RSpec.describe do | |
example do | |
dbl = double | |
allow(dbl).to receive(:x) do |*args| | |
case args.size | |
when 1 then 'foo' | |
when 2 then 'bar' | |
end | |
end | |
expect(dbl.x(10)).to eq 'foo' |
$ irb | |
irb(main):001:0> "".match? /^/ | |
=> true | |
irb(main):002:0> "".match? /$/ | |
=> true | |
irb(main):003:0> "".match? /^$/ | |
=> true | |
irb(main):017:0> code = <<RUBY | |
irb(main):018:0" [1, 2, 3].each do |
tell application "VLC" | |
activate | |
open file "Users:your-name:Documents:some-dvd:VIDEO_TS" | |
play | |
end tell |
mv awesome-project awesome-project.old
)p250で、クラスメソッドをprivateにしたい場合とありますが、privateメソッドは「レシーバを指定して呼び出すことができない」とあるので不思議です。 User.hello のUserはレシーバとは呼ばないのかということです。
https://twitter.com/maehrm/status/979326471075278848
いいえ、User
はレシーバです。なので、クラスメソッドのhello
がprivateメソッドだった場合は、User.hello
のようにレシーバを指定して呼び出すとエラーになります。
# example(it)内でローカル変数を宣言する | |
describe 'convert_hash_syntax' do | |
it '=>が:に置き換わる' do | |
old_syntax = <<~TEXT | |
{ | |
:name => 'Alice', | |
:age => 20, | |
:gender => :female | |
} | |
TEXT |
# Based on http://blog.honeybadger.io/benchmarking-exceptions-in-ruby-yep-theyre-slow/ | |
require 'benchmark/ips' | |
def find_by | |
nil | |
end | |
def find_by! | |
raise 'Not found' | |
end |