Skip to content

Instantly share code, notes, and snippets.

version: 2
jobs:
build:
parallelism: 3
docker:
- image: circleci/ruby:2.4.2-node
environment:
PGHOST: 127.0.0.1
PGUSER: user
RAILS_ENV: test
- run:
command: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
RSpec.configure do |config|
config.before(:each, type: :system) do
driven_by :rack_test
end
config.before(:each, type: :system, js: true) do
if ENV["SELENIUM_DRIVER_URL"].present?
driven_by :selenium, using: :chrome,
options: {
browser: :remote,
@noelrappin
noelrappin / packages.json
Created September 16, 2019 18:57
Atom Sync
Hi

Webpacker

What Is Webpacker?

How is Webpacker Different from Sprockets?

Installing Webpacker

Integrating Frameworks with Webpacker

@noelrappin
noelrappin / Dockerfile
Created May 10, 2022 11:30
Docker Setup for workshop
# syntax=docker/dockerfile:1
FROM ruby:3.1.2
RUN apt-get update -qq && apt-get install -y sqlite3
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
class TestClass
extend Quiz::TestCase
def with_a_user
@user = User.new
end
def with_an_admin
@user = User.new(admin: true)
end
class Consumer
def takes_args(a, b, c)
p "#{a} #{b} #{c}"
end
def takes_keys(a:, b:, c:)
p "#{a} #{b} #{c}"
end
end
@noelrappin
noelrappin / splat_check.rb
Created December 30, 2022 18:00
Splat check
class Consumer
def takes_args(a, b, c)
p "#{a} #{b} #{c}"
end
def takes_keys(a:, b:, c:)
p "#{a} #{b} #{c}"
end
end
@noelrappin
noelrappin / sigilize.rb
Last active February 17, 2023 00:02
Sigilize
class Module
def sigilize(method_name)
define_method("#{method_name}?") do |*args, **kwargs|
!!method_name(*args, **kwargs)
end
define_method("#{method_name}!") do |*args, **kwargs|
result = method_name(*args, **kwargs)
raise StandardError unless result
result