repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/app/mailers/application_mailer.rb
tests/rails-7_capybara-3/app/mailers/application_mailer.rb
class ApplicationMailer < ActionMailer::Base default from: 'from@example.com' end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/app/mailers/spreewald_mailer.rb
tests/rails-7_capybara-3/app/mailers/spreewald_mailer.rb
class SpreewaldMailer < ApplicationMailer REPLY_TO = "reply-to@example.com" TO = "to@example.com" CC = "cc@example.com" BCC = "bcc@example.com" FROM = "from@example.com" SUBJECT = "SUBJECT" def email attachments['attached_file.pdf'] = File.open("#{Rails.root}/public/fixture_files/attachment.pdf", "w"...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/features/support/selenium.rb
tests/rails-7_capybara-3/features/support/selenium.rb
Capybara.register_driver :selenium do |app| options = Selenium::WebDriver::Chrome::Options.new options.add_argument('--headless') unless ENV.key?('NO_HEADLESS') options.add_argument('--disable-infobars') # options.add_option('w3c', false) options.add_emulation(device_metrics: { width: 1280, height: 960, touch...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/features/support/env.rb
tests/rails-7_capybara-3/features/support/env.rb
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. # It is recommended to regenerate this file in the future when you upgrade to a # newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/features/support/paths.rb
tests/rails-7_capybara-3/features/support/paths.rb
module NavigationHelpers def path_to(page_name) case page_name when /^"(.*)"$/ $1 else raise "Can't find mapping from \"#{page_name}\" to a path.\n" + "Now, go and add a mapping in #{__FILE__}" end end end World(NavigationHelpers)
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/features/support/selectors.rb
tests/rails-7_capybara-3/features/support/selectors.rb
module HtmlSelectorsHelpers # Maps a name to a selector. Used primarily by the # # When /^(.+) within (.+)$/ do |step, scope| # # step definitions in web_steps.rb # def selector_for(locator) case locator when /^a panel?$/ '.panel' when /^a panels nested contents?$/ '.panel--nes...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/features/step_definitions/overriding_steps.rb
tests/rails-7_capybara-3/features/step_definitions/overriding_steps.rb
Then /^I should see "overridden value"$/ do expect(page).to have_content('overridden value') end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/features/step_definitions/test_steps.rb
tests/rails-7_capybara-3/features/step_definitions/test_steps.rb
require 'cucumber/rspec/doubles' RSPEC_EXPECTATION_NOT_MET_ERROR = RSpec::Expectations::ExpectationNotMetError Then /^the following steps? should (fail|succeed):$/ do |expectation, steps_table| steps = steps_table.raw.flatten steps.each do |step| if expectation == 'fail' expect { step(step) }.to rais...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/features/step_definitions/field_error_steps.rb
tests/rails-7_capybara-3/features/step_definitions/field_error_steps.rb
Then /^I set the custom field error class to "([^"]+)"$/ do |error_class| Spreewald.field_error_class = error_class end Then /^I set the custom error message xpath to "(.+)"$/ do |error_message_xpath| Spreewald.error_message_xpath_selector = error_message_xpath end After('@field_errors') do Spreewald.field_erro...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/application.rb
tests/rails-7_capybara-3/config/application.rb
require_relative 'boot' require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" # require "active_storage/engine" require "action_controller/railtie" require "action_mailer/railtie" # require "action_mailbox/engine" # require "action_t...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/environment.rb
tests/rails-7_capybara-3/config/environment.rb
# Load the Rails application. require_relative 'application' # Initialize the Rails application. Rails.application.initialize!
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/routes.rb
tests/rails-7_capybara-3/config/routes.rb
Rails.application.routes.draw do get '/authenticated/page', to: 'authenticated#page' get '/downloads/spreadsheet', to: 'downloads#spreadsheet' get '/downloads/spreadsheet', to: 'downloads#spreadsheet' get '/emails/do_nothing', to: 'emails#do_nothing' get '/emails/send_email', to: 'emails#send_email' get '...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/boot.rb
tests/rails-7_capybara-3/config/boot.rb
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) require 'bundler/setup' # Set up gems listed in the Gemfile.
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/content_security_policy.rb
tests/rails-7_capybara-3/config/initializers/content_security_policy.rb
# Be sure to restart your server when you modify this file. # Define an application-wide content security policy # For further information see the following documentation # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy # Rails.application.config.content_security_policy do |policy| ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/filter_parameter_logging.rb
tests/rails-7_capybara-3/config/initializers/filter_parameter_logging.rb
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += [ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn ]
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/application_controller_renderer.rb
tests/rails-7_capybara-3/config/initializers/application_controller_renderer.rb
# Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do # ApplicationController.renderer.defaults.merge!( # http_host: 'example.org', # https: false # ) # end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/wrap_parameters.rb
tests/rails-7_capybara-3/config/initializers/wrap_parameters.rb
# Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters f...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/inflections.rb
tests/rails-7_capybara-3/config/initializers/inflections.rb
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/cookies_serializer.rb
tests/rails-7_capybara-3/config/initializers/cookies_serializer.rb
# Be sure to restart your server when you modify this file. # Specify a serializer for the signed and encrypted cookie jars. # Valid options are :json, :marshal, and :hybrid. Rails.application.config.action_dispatch.cookies_serializer = :json
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/permissions_policy.rb
tests/rails-7_capybara-3/config/initializers/permissions_policy.rb
# Define an application-wide HTTP permissions policy. For further # information see https://developers.google.com/web/updates/2018/06/feature-policy # # Rails.application.config.permissions_policy do |f| # f.camera :none # f.gyroscope :none # f.microphone :none # f.usb :none # f.fullscreen :s...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/backtrace_silencers.rb
tests/rails-7_capybara-3/config/initializers/backtrace_silencers.rb
# Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } # You can also remove all the silencers if you're trying to debug a ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/mime_types.rb
tests/rails-7_capybara-3/config/initializers/mime_types.rb
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/initializers/new_framework_defaults_6_1.rb
tests/rails-7_capybara-3/config/initializers/new_framework_defaults_6_1.rb
# Be sure to restart your server when you modify this file. # # This file contains migration options to ease your Rails 6.1 upgrade. # # Once upgraded flip defaults one by one to migrate to the new default. # # Read the Guide for Upgrading Ruby on Rails for more info on each option. # Support for inversing belongs_to ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/environments/test.rb
tests/rails-7_capybara-3/config/environments/test.rb
require "active_support/core_ext/integer/time" # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data the...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/tests/rails-7_capybara-3/config/environments/development.rb
tests/rails-7_capybara-3/config/environments/development.rb
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for developme...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/features/support/aruba.rb
features/support/aruba.rb
require 'aruba/cucumber'
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/features/support/step_definitions/custom_steps.rb
features/support/step_definitions/custom_steps.rb
Then /^the output should( not)? contain \/(.*)\/$/ do |negated, regexp| output = all_commands.map { |c| c.output }.join("\n") regexp = Regexp.new(regexp) if negated expect(output).not_to match(regexp) else expect(output).to match(regexp) end end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/spec_helper.rb
spec/spec_helper.rb
require 'bundler' Bundler.setup require 'pathname' require 'capybara' Dir[Pathname.new(__FILE__).join('..', 'support', '**', '*.rb')].each { |f| require f } # This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # Th...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/support/world.rb
spec/support/world.rb
class World class Driver def wait? true end end class Page def driver @driver ||= Driver.new end end def page @page ||= Page.new end end def World(mod) World.class_eval do include mod end end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/spreewald_support/comparision_spec.rb
spec/spreewald_support/comparision_spec.rb
require 'spreewald_support/comparison' describe Spreewald::Comparison do describe 'compare_versions' do it 'returns true for `2.4.0 < 2.12` ' do comp = Spreewald::Comparison.compare_versions('2.4.0', :<, '2.12') expect(comp).to be_truthy end end end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/spreewald_support/mail_to_plaintext_converter_spec.rb
spec/spreewald_support/mail_to_plaintext_converter_spec.rb
require "spreewald_support/mail_to_plaintext_converter" require "mail" describe Spreewald::MailToPlaintextConverter do describe '#run' do context 'with multipart email' do let(:multipart_email) do Mail.new do text_part do body "email text part" end html_pa...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/spreewald_support/tolerance_for_selenium_sync_issues_spec.rb
spec/spreewald_support/tolerance_for_selenium_sync_issues_spec.rb
require 'spreewald_support/tolerance_for_selenium_sync_issues' describe ToleranceForSeleniumSyncIssues do subject { World.new } let(:wait_time) { 0.2 } before do Capybara.default_max_wait_time = wait_time allow(subject.page.driver).to receive(:wait?).and_return(true) end describe '#patiently' do ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/spreewald_support/without_waiting_spec.rb
spec/spreewald_support/without_waiting_spec.rb
require 'spreewald_support/without_waiting' describe Spreewald::WithoutWaiting do subject do Class.new do include Spreewald::WithoutWaiting end.new end describe '#without_waiting' do it 'calls the block while setting the Capybara wait time to 0' do wait_time_in_block = nil subject...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/steps/show_me_the_mails_spec.rb
spec/steps/show_me_the_mails_spec.rb
require "steps/show_me_the_mails" describe Spreewald::Steps::ShowMeTheMails do context "without deliveries" do it "logs 'no emails found'" do step = Spreewald::Steps::ShowMeTheMails.new([]) expect { step.run }.to output("No emails found\n").to_stdout end it "logs 'no emails found' with only...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/spec/steps/follow_the_link_spec.rb
spec/steps/follow_the_link_spec.rb
require "steps/follow_the_link" describe Spreewald::Steps::FollowTheLink do it "raises helpful error message if no link is found" do mail_without_links = Mail.new do html_part do body "<html><body>no link</body></html>" end text_part do body "no link either" end end ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/examples/paths.rb
examples/paths.rb
# Put this into features/support # module NavigationHelpers # Maps a name to a path. Used by the # # When /^I go to (.+)$/ do |page_name| # # step definition in web_steps.feature # def path_to(page_name) case page_name when /^the home\s?page$/ root_path when /^the (page|form) for the...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/examples/selectors.rb
examples/selectors.rb
# Put this into features/support module HtmlSelectorsHelpers # Maps a name to a selector. Used primarily by the # # When /^(.+) within (.+)$/ do |step, scope| # # step definitions in web_steps.feature # def selector_for(locator) case locator when "the page" "html > body" # Auto-mappe...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald.rb
lib/spreewald.rb
# coding: UTF-8 require 'cucumber_priority' require "spreewald_support/version" require "spreewald_support/github" require "spreewald_support/unsupported_email_header"
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/development_steps.rb
lib/spreewald/development_steps.rb
# coding: UTF-8 # Marks scenario as pending, optionally explained with a reason. Then /^it should work(.+?)?$/ do |message| pending(message) end.overridable # Pauses test execution and opens an IRB shell with current context. Does not halt the application- # under-test. Then 'console' do require 'irb' ARGV.clea...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/web_steps.rb
lib/spreewald/web_steps.rb
# coding: UTF-8 # Most of cucumber-rails' original web steps plus a few of our own. # # Note that cucumber-rails deprecated all its steps quite a while ago with the following # deprecation notice. Decide for yourself whether you want to use them: # # > This file was generated by Cucumber-Rails and is only here to get ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/time_steps.rb
lib/spreewald/time_steps.rb
# coding: UTF-8 # Steps to travel through time # # This uses [Timecop](https://github.com/jtrupiano/timecop) or Active Support 4.1+ to stub Time.now / Time.current. # The user is responsible for including one of the two gems. # # Please note that the two approaches branch. While ActiveSupport will freeze the time, Ti...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/table_steps.rb
lib/spreewald/table_steps.rb
# coding: UTF-8 require 'spreewald_support/tolerance_for_selenium_sync_issues' require 'spreewald_support/compatibility' module TableStepsHelper module ArrayMethods def find_row(expected_row) find_index do |row| expected_row.all? do |expected_column| first_column = row.find_index do |c...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/browser_tab_steps.rb
lib/spreewald/browser_tab_steps.rb
Before do @previous_browser_tabs_count = nil end # Close all but the first browser tab After do next unless selenium_driver? browser.switch_to.window(browser.window_handles.last) while browser.window_handles.size > 1 do browser.close browser.switch_to.window(browser.window_handles.last) end end # O...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/all_steps.rb
lib/spreewald/all_steps.rb
# coding: UTF-8 require 'rspec/matchers' ALREADY_LOADED_FILES = %w[all_steps timecop_steps] Dir[File.join(File.dirname(__FILE__), '*_steps.rb')].each do |f| name = File.basename(f, '.rb') unless ALREADY_LOADED_FILES.include?(name) require "spreewald/#{name}" end end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/frame_steps.rb
lib/spreewald/frame_steps.rb
# You can append `inside the [name or number] iframe` to any other step. # Then the step will operate inside the given iframe. # Examples: # # Then I should see "Kiwi" inside the 1st iframe # Then I should see "Cherry" inside the fruits iframe # When I press "Save" inside the 2nd iframe # When /^(.*?) insid...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/session_steps.rb
lib/spreewald/session_steps.rb
# You can append `in the browser session "name"` to any other step to execute # the step in a different browser session. # # You may need to update other steps to allow multiple sessions (e.g. your # authentication steps have to support multiple logged in users). # More details [here](https://makandracards.com/makandra...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald/email_steps.rb
lib/spreewald/email_steps.rb
# coding: UTF-8 require 'spreewald_support/mail_finder' require 'steps/show_me_the_mails' require 'steps/follow_the_link' Before do ActionMailer::Base.deliveries.clear end When /^I clear my e?mails$/ do ActionMailer::Base.deliveries.clear end.overridable # Example: # # Then an email should have been sent wi...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/web_steps_helpers.rb
lib/spreewald_support/web_steps_helpers.rb
require 'spreewald_support/comparison' module WebStepsHelpers def assert_visible(options) visibility_test(options.merge(:expectation => :visible)) end def assert_hidden(options) visibility_test(options.merge(:expectation => :hidden)) end def find_with_disabled(*args, **options, &optional_filter_bl...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/version.rb
lib/spreewald_support/version.rb
module Spreewald VERSION = '4.6.4' end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/field_errors.rb
lib/spreewald_support/field_errors.rb
require 'spreewald_support/driver_info' require 'spreewald_support/without_waiting' module Spreewald def self.field_error_class self.instance_variable_get('@field_error_class') end def self.field_error_class=(error_class) self.instance_variable_set('@field_error_class', error_class) end def self.er...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/mail_to_plaintext_converter.rb
lib/spreewald_support/mail_to_plaintext_converter.rb
require 'nokogiri' module Spreewald class MailToPlaintextConverter def initialize(mail, type = '') @mail = mail @type = type end def run body = '' if mail.multipart? body = if mail.html_part && type != 'plain-text' text_from_html(mail.html_part.body.to_s) ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/github.rb
lib/spreewald_support/github.rb
# coding: UTF-8 module Spreewald def self.github_url "https://github.com/makandra/spreewald" end end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/capybara_wrapper.rb
lib/spreewald_support/capybara_wrapper.rb
module Spreewald class CapybaraWrapper def self.default_max_wait_time if Capybara.respond_to?(:default_max_wait_time) Capybara.default_max_wait_time else Capybara.default_wait_time end end def self.default_max_wait_time=(value) if Capybara.respond_to?(:default_max_...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/unsupported_email_header.rb
lib/spreewald_support/unsupported_email_header.rb
module Spreewald SUPPORTED_EMAIL_HEADERS = ["To", "CC", "BCC", "From", "Reply-To", "Subject", "Attachments"] class UnsupportedEmailHeader < StandardError attr_reader :header, :value def initialize(header, value) @header, @value = header, value error_message = <<-MESSAGE.strip_heredoc I...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/mail_finder.rb
lib/spreewald_support/mail_finder.rb
# coding: UTF-8 require "spreewald_support/mail_to_plaintext_converter" require "forwardable" class MailFinder class << self attr_accessor :user_identity def find(raw_data, type = '') header, body = raw_data.split(/\n\n/, 2).map(&:strip_heredoc) # 2: maximum number of fields conditions = {} ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/step_fallback.rb
lib/spreewald_support/step_fallback.rb
# coding: UTF-8 module StepFallback def step(*args) if defined?(super) super else When(*args) end end end World(StepFallback)
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/path_selector_fallbacks.rb
lib/spreewald_support/path_selector_fallbacks.rb
# coding: UTF-8 module PathSelectorFallbacks def _selector_for(locator) if respond_to?(:selector_for) selector_for(locator) elsif locator =~ /^"(.+)"$/ $1 else raise "Can't find mapping from \"#{locator}\" to a selector.\n" + "Add a selectors.rb file (compare #{Spreewald.github_...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/compatibility.rb
lib/spreewald_support/compatibility.rb
module Spreewald module Compatibility def self.spreewald_failure_message(context, &block) if context.respond_to?(:failure_message) context.failure_message(&block) else context.failure_message_for_should(&block) end end def self.spreewald_failure_message_negated(context,...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/comparison.rb
lib/spreewald_support/comparison.rb
module Spreewald module Comparison def self.compare_versions(gem_version, operator, compare_to) Gem::Version.new(gem_version).send(operator, Gem::Version.new(compare_to)) end end end
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/without_waiting.rb
lib/spreewald_support/without_waiting.rb
require 'spreewald_support/capybara_wrapper' module Spreewald module WithoutWaiting def without_waiting prior_max_wait_time = CapybaraWrapper.default_max_wait_time CapybaraWrapper.default_max_wait_time = 0 yield ensure CapybaraWrapper.default_max_wait_time = prior_max_wait_time en...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/tolerance_for_selenium_sync_issues.rb
lib/spreewald_support/tolerance_for_selenium_sync_issues.rb
require 'spreewald_support/capybara_wrapper' module ToleranceForSeleniumSyncIssues RETRY_ERRORS = %w[ ActionController::UrlGenerationError Capybara::ElementNotFound Spec::Expectations::ExpectationNotMetError RSpec::Expectations::ExpectationNotMetError Minitest::Assertion Capybara::Poltergeist...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/custom_matchers.rb
lib/spreewald_support/custom_matchers.rb
require 'spreewald_support/compatibility' module CustomMatchers rspec = defined?(RSpec) ? RSpec : Spec rspec::Matchers.define :contain_with_wildcards do |expected_string| match do |field_value| @field_value = field_value.to_s @expected_string = expected_string regex_parts = expected_string.t...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/spreewald_support/driver_info.rb
lib/spreewald_support/driver_info.rb
module Spreewald module DriverInfo def javascript_capable? selenium_driver? || poltergeist_driver? || webkit_driver? end def selenium_driver? Object.const_defined?('Capybara::Selenium') && Capybara.current_session.driver.is_a?(Capybara::Selenium::Driver) end def poltergeist_driver? ...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/steps/show_me_the_mails.rb
lib/steps/show_me_the_mails.rb
require 'spreewald_support/mail_finder' module Spreewald module Steps class ShowMeTheMails def initialize(mails, only_header = false) @mails = mails @only_header = only_header end def run if @mails.empty? puts "No emails found" else puts Mail...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
makandra/spreewald
https://github.com/makandra/spreewald/blob/04cdad6e318ea3ce16ab9bbf1c71182dc10165ee/lib/steps/follow_the_link.rb
lib/steps/follow_the_link.rb
module Spreewald module Steps class FollowTheLink class NoVisitableLinkFound < StandardError def initialize(paths, index) error_message = <<~MESSAGE Could not follow the #{index} link in the email. MESSAGE if paths&.empty? error_message << "Found...
ruby
MIT
04cdad6e318ea3ce16ab9bbf1c71182dc10165ee
2026-01-04T17:42:32.649845Z
false
deadprogram/frankie
https://github.com/deadprogram/frankie/blob/0acfaf1f669f24858fa703c249657f7285961d82/test/frankie_test.rb
test/frankie_test.rb
require File.dirname(__FILE__) + '/helper' context "frankie" do it "should be a placeholder for a real test" do end end
ruby
MIT
0acfaf1f669f24858fa703c249657f7285961d82
2026-01-04T17:42:41.061128Z
false
deadprogram/frankie
https://github.com/deadprogram/frankie/blob/0acfaf1f669f24858fa703c249657f7285961d82/test/helper.rb
test/helper.rb
require 'rubygems' require 'sinatra' require File.dirname(__FILE__) + '/../lib/frankie' require 'sinatra/test/spec'
ruby
MIT
0acfaf1f669f24858fa703c249657f7285961d82
2026-01-04T17:42:41.061128Z
false
deadprogram/frankie
https://github.com/deadprogram/frankie/blob/0acfaf1f669f24858fa703c249657f7285961d82/lib/frankie.rb
lib/frankie.rb
# frankie - a plugin for sinatra that integrates with the facebooker gem # # written by Ron Evans (http://www.deadprogrammersociety.com) # # based on merb_facebooker (http://github.com/vanpelt/merb_facebooker) # and the Rails classes in Facebooker (http://facebooker.rubyforge.org/) from Mike Mangino, Shane Vitarana, &...
ruby
MIT
0acfaf1f669f24858fa703c249657f7285961d82
2026-01-04T17:42:41.061128Z
false
hopsoft/sr_mini
https://github.com/hopsoft/sr_mini/blob/3a4b644b5c84bc638b642ebe314601c5706e4f14/application.rb
application.rb
require "bundler/inline" gemfile true do source "https://rubygems.org" gem "rails", "~> 6.1.3" gem "redis", "~> 4.2.5" gem "cable_ready", "~> 4.5.0" gem "stimulus_reflex", "~> 3.4.1" gem "puma", "~> 5.2.2" gem "pry" end require "action_controller/railtie" require "rails/command" require "rails/commands/...
ruby
MIT
3a4b644b5c84bc638b642ebe314601c5706e4f14
2026-01-04T17:42:37.483412Z
false
FooBarWidget/heap_dumper_visualizer
https://github.com/FooBarWidget/heap_dumper_visualizer/blob/484c3874fd25e789a05e786485ff914e43522e2c/visualize_heap.rb
visualize_heap.rb
#!/usr/bin/env ruby # frozen_string_literal: true require 'oily_png' require 'erb' module HeapVisualizer PAGE_SIZE = 4096 PAGE_SIZE_MASK = PAGE_SIZE - 1 BLOCK_SIZE = 16 class Heap < Struct.new(:number, :addr, :size, :chunks, :pages, :page_dirtiness) def initialize(*args) super self.chunks ||= ...
ruby
MIT
484c3874fd25e789a05e786485ff914e43522e2c
2026-01-04T17:42:41.088921Z
false
uasi/skk-emoji-jisyo
https://github.com/uasi/skk-emoji-jisyo/blob/18ff911d0dc445dbc8fbc4c5122874d08e56781b/generate_jisyo.rb
generate_jisyo.rb
#!/usr/bin/env ruby require 'time' require 'bundler' require 'optparse' Bundler.require prefix = '' opt = OptionParser.new opt.on('-p VAL', '--prefix=VAL') do |p| prefix = p end opt.parse ARGV Entry = Struct.new(:name, :raw) do def <=>(that) name <=> that.name end end entries = Emoji.all.flat_map do |emoji...
ruby
MIT
18ff911d0dc445dbc8fbc4c5122874d08e56781b
2026-01-04T17:42:42.467349Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/rails_helper.rb
test/rails_helper.rb
# frozen_string_literal: true ENV['RAILS_ENV'] = 'test' require_relative '../test/dummy/config/environment' ActiveRecord::Migrator.migrations_paths = [File.expand_path( '../test/dummy/db/migrate', __dir__ )] require 'rails/test_help' # Load fixtures from the engine if ActiveSupport::TestCase.respond_to?(:fixture_p...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/application_system_test_case.rb
test/application_system_test_case.rb
# frozen_string_literal: true require 'rails_helper' require 'webdrivers/chromedriver' require 'action_dispatch/system_testing/server' ActionDispatch::SystemTesting::Server.silence_puma = true class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: :headless_chrome do |options|...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/test_helper.rb
test/test_helper.rb
# frozen_string_literal: true require 'minitest/autorun' require 'pry-byebug' require 'upgrow' Warning[:deprecated] = true
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/system/articles_test.rb
test/system/articles_test.rb
# frozen_string_literal: true require 'application_system_test_case' class ArticlesTest < ApplicationSystemTestCase test 'a message is shown when there are no Articles' do visit root_path assert_title 'Articles' assert_text 'There are no Articles just yet.' end test 'Article can be created' do ...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/upgrow/documentation_test.rb
test/upgrow/documentation_test.rb
# frozen_string_literal: true require 'test_helper' require 'yard' module Upgrow class DocumentationTest < ActiveSupport::TestCase test 'documentation is correctly written' do assert_empty(%x(bundle exec yard --no-save --no-output --no-stats)) end end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/upgrow/model_test.rb
test/upgrow/model_test.rb
# frozen_string_literal: true require 'test_helper' module Upgrow class ModelTest < ActiveSupport::TestCase test '.new returns a Model class with the given members, id, and timestamps' do model_class = Model.new(:name) assert_equal([:name, :id, :created_at, :updated_at], model_class.members) end...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/upgrow/immutable_struct_test.rb
test/upgrow/immutable_struct_test.rb
# frozen_string_literal: true require 'test_helper' module Upgrow class ImmutableStructTest < ActiveSupport::TestCase test '.new creates a new Struct class with the given members as keyword arguments' do struct_class = ImmutableStruct.new(:user, :post) struct = struct_class.new(user: 'volmer', post...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/upgrow/result_test.rb
test/upgrow/result_test.rb
# frozen_string_literal: true require 'test_helper' module Upgrow class ResultTest < ActiveSupport::TestCase setup do @errors = [:error] end test '.new returns a Result class with the given members and errors' do result_class = Result.new(:user) assert_equal([:user, :errors], result_c...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/upgrow/action_test.rb
test/upgrow/action_test.rb
# frozen_string_literal: true require 'test_helper' module Upgrow class ActionTest < ActiveSupport::TestCase test '.result_class is an empty Result by default' do assert_equal([:errors], Action.result_class.members) end test '.result sets the members in the Action Result class' do result_cl...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/jobs/application_job.rb
test/dummy/app/jobs/application_job.rb
# frozen_string_literal: true class ApplicationJob < ActiveJob::Base # Automatically retry jobs that encountered a deadlock # retry_on ActiveRecord::Deadlocked # Most jobs are safe to ignore if the underlying records are no longer # available # discard_on ActiveJob::DeserializationError end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/helpers/application_helper.rb
test/dummy/app/helpers/application_helper.rb
# frozen_string_literal: true module ApplicationHelper class BulmaFormBuilder < ActionView::Helpers::FormBuilder # Generic field wrapper for form inputs. # # It wraps the given block in a field div. In case a method is specified it # also prepends a label tag for the input and renders any errors for t...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/controllers/articles_controller.rb
test/dummy/app/controllers/articles_controller.rb
# frozen_string_literal: true class ArticlesController < ApplicationController def index @articles = ListArticlesAction.new.perform.articles end def show @article = ShowArticleAction.new.perform(params[:id]).article end def new @input = ArticleInput.new end def edit article = EditArtic...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/controllers/application_controller.rb
test/dummy/app/controllers/application_controller.rb
# frozen_string_literal: true class ApplicationController < ActionController::Base end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/actions/list_articles_action.rb
test/dummy/app/actions/list_articles_action.rb
# frozen_string_literal: true class ListArticlesAction < Upgrow::Action result :articles def perform result.success(articles: ArticleRepository.new.all) end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/actions/create_article_action.rb
test/dummy/app/actions/create_article_action.rb
# frozen_string_literal: true class CreateArticleAction < Upgrow::Action result :article def perform(input) if input.valid? article = ArticleRepository.new.create(input) result.success(article: article) else result.failure(input.errors) end end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/actions/edit_article_action.rb
test/dummy/app/actions/edit_article_action.rb
# frozen_string_literal: true class EditArticleAction < Upgrow::Action result :article def perform(id) article = ArticleRepository.new.find(id) result.success(article: article) end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/actions/update_article_action.rb
test/dummy/app/actions/update_article_action.rb
# frozen_string_literal: true class UpdateArticleAction < Upgrow::Action result :article def perform(id, input) if input.valid? article = ArticleRepository.new.update(id, input) result.success(article: article) else result.failure(input.errors) end end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/actions/delete_article_action.rb
test/dummy/app/actions/delete_article_action.rb
# frozen_string_literal: true class DeleteArticleAction < Upgrow::Action def perform(id) ArticleRepository.new.delete(id) result.success end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/actions/show_article_action.rb
test/dummy/app/actions/show_article_action.rb
# frozen_string_literal: true class ShowArticleAction < Upgrow::Action result :article def perform(id) article = ArticleRepository.new.find(id) result.success(article: article) end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/models/article.rb
test/dummy/app/models/article.rb
# frozen_string_literal: true Article = Upgrow::Model.new(:title, :body)
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/repositories/article_repository.rb
test/dummy/app/repositories/article_repository.rb
# frozen_string_literal: true class ArticleRepository def all ArticleRecord.all.map do |record| to_model(record.attributes) end end def create(input) record = ArticleRecord.create!(title: input.title, body: input.body) to_model(record.attributes) end def find(id) record = ArticleRe...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/inputs/article_input.rb
test/dummy/app/inputs/article_input.rb
# frozen_string_literal: true class ArticleInput < Upgrow::Input attr_accessor :title, :body validates :title, presence: true validates :body, presence: true, length: { minimum: 10 } end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/mailers/application_mailer.rb
test/dummy/app/mailers/application_mailer.rb
# frozen_string_literal: true class ApplicationMailer < ActionMailer::Base default from: 'from@example.com' layout 'mailer' end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/records/application_record.rb
test/dummy/app/records/application_record.rb
# frozen_string_literal: true class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/records/article_record.rb
test/dummy/app/records/article_record.rb
# frozen_string_literal: true class ArticleRecord < ApplicationRecord self.table_name = 'articles' end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/channels/application_cable/channel.rb
test/dummy/app/channels/application_cable/channel.rb
# frozen_string_literal: true module ApplicationCable class Channel < ActionCable::Channel::Base end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/app/channels/application_cable/connection.rb
test/dummy/app/channels/application_cable/connection.rb
# frozen_string_literal: true module ApplicationCable class Connection < ActionCable::Connection::Base end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/db/schema.rb
test/dummy/db/schema.rb
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false
szTheory/upgrow
https://github.com/szTheory/upgrow/blob/d85320dda3ec569c7a722ccfb17aad857681a5fd/test/dummy/db/migrate/20210219211631_create_articles.rb
test/dummy/db/migrate/20210219211631_create_articles.rb
# frozen_string_literal: true class CreateArticles < ActiveRecord::Migration[6.1] def change create_table(:articles) do |t| t.string(:title, null: false) t.text(:body, null: false) t.timestamps end end end
ruby
MIT
d85320dda3ec569c7a722ccfb17aad857681a5fd
2026-01-04T17:42:37.636615Z
false