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 |
|---|---|---|---|---|---|---|---|---|
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph/symbol.rb | lib/jazzy/symbol_graph/symbol.rb | # frozen_string_literal: true
# rubocop:disable Metrics/ClassLength
module Jazzy
module SymbolGraph
# A Symbol is a tidied-up SymbolGraph JSON object
class Symbol
attr_accessor :usr
attr_accessor :path_components
attr_accessor :declaration
attr_accessor :kind
attr_accessor :acl
... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
realm/jazzy | https://github.com/realm/jazzy/blob/8852cdba0fd95acab32bb121fc495abe2fbe5fc8/lib/jazzy/symbol_graph/ext_key.rb | lib/jazzy/symbol_graph/ext_key.rb | # frozen_string_literal: true
module Jazzy
module SymbolGraph
# An ExtKey identifies an extension of a type, made up of the USR of
# the type and the constraints of the extension. With Swift 5.9 extension
# symbols, the USR is the 'fake' USR invented by symbolgraph to solve the
# same problem as thi... | ruby | MIT | 8852cdba0fd95acab32bb121fc495abe2fbe5fc8 | 2026-01-04T15:39:34.502623Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require "pathname"
SPEC_ROOT = File.expand_path(__dir__).freeze
LOG_DIR = Pathname(SPEC_ROOT).join("..").join("log")
require_relative "support/coverage" if ENV["COVERAGE"].eql?("true")
require "hanami"
begin; require "byebug"; rescue LoadError; end
require "hanami/utils/file_list"
requ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/support/matchers.rb | spec/support/matchers.rb | # frozen_string_literal: true
module RSpec
module Support
module Matchers
module HTML
def squish_html(str)
str
.gsub(/^[[:space:]]+/, "")
.gsub(/>[[:space:]]+</m, "><")
.strip
end
end
end
end
end
RSpec::Matchers.define :eq_html do |... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/support/coverage.rb | spec/support/coverage.rb | require "hanami/devtools/unit/support/coverage"
| ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/support/app_integration.rb | spec/support/app_integration.rb | # frozen_string_literal: true
require "hanami/devtools/integration/files"
require "hanami/devtools/integration/with_tmp_directory"
require "json"
require "tmpdir"
require "zeitwerk"
module RSpec
module Support
module WithTmpDirectory
private
def make_tmp_directory
Pathname(Dir.mktmpdir).tap... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/support/rspec.rb | spec/support/rspec.rb | # frozen_string_literal: true
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.before :suite do
require "hanami/d... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/setup_spec.rb | spec/integration/setup_spec.rb | # frozen_string_literal: true
RSpec.describe "Hanami setup", :app_integration do
describe "Hanami.setup" do
shared_examples "hanami setup" do
it "requires the app file when found" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/slices_spec.rb | spec/integration/slices_spec.rb | # frozen_string_literal: true
RSpec.describe "Slices", :app_integration do
specify "Loading a slice from a slice class in the app's config dir" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::App
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/dotenv_loading_spec.rb | spec/integration/dotenv_loading_spec.rb | # frozen_string_literal: true
# rubocop:disable Style/FetchEnvVar
RSpec.describe "Dotenv loading", :app_integration do
before do
@orig_env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@orig_env)
end
context "dotenv gem is available" do
befor... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/rake_tasks_spec.rb | spec/integration/rake_tasks_spec.rb | # frozen_string_literal: true
require "rake"
require "hanami/cli/bundler"
RSpec.describe "Rake tasks", :app_integration do
describe "assets:precompile" do
before do
allow(Hanami).to receive(:bundled?)
allow(Hanami).to receive(:bundled?).with("hanami-assets").and_return(hanami_assets_bundled)
end... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/logging/notifications_spec.rb | spec/integration/logging/notifications_spec.rb | # frozen_string_literal: true
require "rack/test"
RSpec.describe "Logging / Notifications", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
specify "Request logging continues even when notifications bus has already been used" do
dir = Dir.mktmpdir
with_tmp_directory(dir) do
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/logging/request_logging_spec.rb | spec/integration/logging/request_logging_spec.rb | # frozen_string_literal: true
require "json"
require "rack/test"
require "stringio"
RSpec.describe "Logging / Request logging", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
let(:logger_stream) { StringIO.new }
let(:logger_level) { nil }
let(:root) { make_tmp_directory }
de... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/logging/exception_logging_spec.rb | spec/integration/logging/exception_logging_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Logging / Exception logging", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
let(:logger_stream) { StringIO.new }
def configure_logger
Hanami.app.config.logger.stream = logger_stream
end
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/settings/access_in_slice_class_body_spec.rb | spec/integration/settings/access_in_slice_class_body_spec.rb | # frozen_string_literal: true
RSpec.describe "Settings / Access within slice class bodies", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
context "app class" do
it "provides access to the settings i... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/settings/settings_component_loading_spec.rb | spec/integration/settings/settings_component_loading_spec.rb | # frozen_string_literal: true
RSpec.describe "Settings / Component loading", :app_integration do
describe "Settings are loaded from a class defined in config/settings.rb" do
specify "in app" do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~'RUBY'
require "hanami"
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/settings/using_types_spec.rb | spec/integration/settings/using_types_spec.rb | # frozen_string_literal: true
require "hanami/settings"
RSpec.describe "Settings / Using types", :app_integration do
before do
@env = ENV.to_h
end
after do
ENV.replace(@env)
end
specify "types from a provided types module can be used as setting constructors to coerce values" do
with_tmp_direct... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/settings/access_to_constants_spec.rb | spec/integration/settings/access_to_constants_spec.rb | # frozen_string_literal: true
RSpec.describe "Settings / Access to constants", :app_integration do
before do
@env = ENV.to_h
end
after do
ENV.replace(@env)
end
specify "Settings can not access autoloadable constants" do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~'RUBY... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/settings/loading_from_env_spec.rb | spec/integration/settings/loading_from_env_spec.rb | # frozen_string_literal: true
RSpec.describe "Settings / Access to constants", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
specify "settings are loaded from ENV" do
with_tmp_directory(Dir.mktmpdir... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/settings/slice_registration_spec.rb | spec/integration/settings/slice_registration_spec.rb | # frozen_string_literal: true
RSpec.describe "Settings / Slice registration", :app_integration do
specify "Settings are registered for each slice with a settings file" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/standard_providers_spec.rb | spec/integration/container/standard_providers_spec.rb | RSpec.describe "Container / Standard providers", :app_integration do
specify "Standard components are available on booted container" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::App
end
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/application_routes_helper_spec.rb | spec/integration/container/application_routes_helper_spec.rb | # frozen_string_literal: true
require "stringio"
RSpec.describe "App routes helper", :app_integration do
specify "Routing to actions based on their container identifiers" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/autoloader_spec.rb | spec/integration/container/autoloader_spec.rb | RSpec.describe "App autoloader", :app_integration do
specify "Classes are autoloaded through direct reference, including through components resolved from the container" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/imports_spec.rb | spec/integration/container/imports_spec.rb | # frozen_string_literal: true
RSpec.describe "Container imports", :app_integration do
xspecify "App container is imported into slice containers by default" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::Ap... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/auto_injection_spec.rb | spec/integration/container/auto_injection_spec.rb | # frozen_string_literal: true
RSpec.describe "Container auto-injection (aka \"Deps\") mixin", :app_integration do
# rubocop:disable Metrics/MethodLength
def with_app
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < H... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/provider_lifecycle_spec.rb | spec/integration/container/provider_lifecycle_spec.rb | # frozen_string_literal: true
RSpec.describe "Container / Provider lifecycle", :app_integration do
let!(:slice) {
module TestApp
class App < Hanami::App
register_provider :connection do
prepare do
module ::TestApp
class Connection
def initialize
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/prepare_container_spec.rb | spec/integration/container/prepare_container_spec.rb | # frozen_string_literal: true
RSpec.describe "Container / prepare_container", :app_integration do
# (Most of) the examples below make their expectations on a `container_to_prepare`,
# which is the container yielded to the `Slice.prepare_container` block _at the moment
# it is called_.
#
# This around hook en... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/shutdown_spec.rb | spec/integration/container/shutdown_spec.rb | # frozen_string_literal: true
RSpec.describe "App shutdown", :app_integration do
specify "App shutdown stops providers in both the app and slices" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
# frozen_string_literal: true
require "hanami"
module TestApp
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/auto_registration_spec.rb | spec/integration/container/auto_registration_spec.rb | # frozen_string_literal: true
RSpec.describe "Container auto-registration", :app_integration do
specify "Auto-registering files in slice source directories" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::A... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/provider_environment_spec.rb | spec/integration/container/provider_environment_spec.rb | # frozen_string_literal: true
RSpec.describe "Container / Provider environment", :app_integration do
let!(:app) {
module TestApp
class App < Hanami::App
class << self
attr_accessor :test_provider_target
end
end
end
before_prepare if respond_to?(:before_prepare)
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/container/standard_providers/rack_provider_spec.rb | spec/integration/container/standard_providers/rack_provider_spec.rb | RSpec.describe "Container / Standard providers / Rack", :app_integration do
specify "Rack provider is loaded when rack is bundled" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::App
end
en... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/slices_importing_from_parent.rb | spec/integration/db/slices_importing_from_parent.rb | # frozen_string_literal: true
RSpec.describe "DB / Slices / Importing from app", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
specify "app DB components do not import into slices by default" do
wit... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/provider_spec.rb | spec/integration/db/provider_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Provider", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "is registered when only a config/db/ dir exists" do
with_tmp_directory(Dir.mktmpdir) d... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/db_slices_spec.rb | spec/integration/db/db_slices_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Slices", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
specify "slices using the same database_url and extensions share a gateway/connection" do
wi... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/provider_config_spec.rb | spec/integration/db/provider_config_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Provider / Config", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
describe "default config" do
it "provides default plugins and extensions" do
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/repo_spec.rb | spec/integration/db/repo_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Repo", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
specify "repos have a root inferred from their name, or can set their own" do
with_tmp_directo... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/logging_spec.rb | spec/integration/db/logging_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Logging", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "logs SQL queries" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/relations_spec.rb | spec/integration/db/relations_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Relations", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "registers nested relations" do
with_tmp_directory(@dir = Dir.mktmpdir) do
write... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/gateways_spec.rb | spec/integration/db/gateways_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Gateways", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "configures gateways by detecting ENV vars" do
with_tmp_directory(@dir = Dir.mktmpdir) ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/commands_spec.rb | spec/integration/db/commands_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Commands", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "registers custom commands" do
with_tmp_directory(@dir = Dir.mktmpdir) do
write "... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/mappers_spec.rb | spec/integration/db/mappers_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / Mappers", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "registers custom mappers" do
with_tmp_directory(@dir = Dir.mktmpdir) do
write "co... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/auto_registration_spec.rb | spec/integration/db/auto_registration_spec.rb | # frozen_string_literal: true
RSpec.describe "DB / auto-registration", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "does not auto-register files in entities/, structs/, or db/" do
with_tmp_dire... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/db_inflector_spec.rb | spec/integration/db/db_inflector_spec.rb | # frozen_string_literal: true
require "dry/system"
RSpec.describe "ROM::Inflector", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
around :each do |example|
inflector = ROM::Inflector
ROM.instan... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/db/db_spec.rb | spec/integration/db/db_spec.rb | # frozen_string_literal: true
RSpec.describe "DB", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after do
ENV.replace(@env)
end
it "sets up ROM and registers relations" do
with_tmp_directory(Dir.mktmpdir) do
write "config/a... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/format_config_spec.rb | spec/integration/action/format_config_spec.rb | # frozen_string_literal: true
require "json"
require "rack/test"
RSpec.describe "App action / Format config", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
around do |example|
with_tmp_directory(Dir.mktmpdir, &example)
end
it "adds a body parser middleware for the accepted ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/slice_configuration_spec.rb | spec/integration/action/slice_configuration_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / Slice configuration", :app_integration do
before do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~'RUBY'
require "hanami"
module TestApp
class App < Hanami::App
end
end
RUB... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/cookies_spec.rb | spec/integration/action/cookies_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / Cookies", :app_integration do
before do
module TestApp
class App < Hanami::App
end
end
Hanami.app.instance_eval(&app_hook) if respond_to?(:app_hook)
Hanami.app.prepare
module TestApp
class Action < Hanami::Action
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/csrf_protection_spec.rb | spec/integration/action/csrf_protection_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / CSRF protection", :app_integration do
before do
module TestApp
class App < Hanami::App
end
end
Hanami.app.instance_eval(&app_hook) if respond_to?(:app_hook)
Hanami.app.register_slice :main
Hanami.app.prepare
module TestA... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/routes_spec.rb | spec/integration/action/routes_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / Routes", :app_integration do
specify "Access app routes from an action" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::App; end
end
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/sessions_spec.rb | spec/integration/action/sessions_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / Sessions", :app_integration do
before do
module TestApp
class App < Hanami::App
end
end
Hanami.app.instance_eval(&app_hook) if respond_to?(:app_hook)
Hanami.app.prepare
module TestApp
class Action < Hanami::Action
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/view_rendering_spec.rb | spec/integration/action/view_rendering_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / View rendering", :app_integration do
specify "Views render with a request-specific context object" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/view_rendering/view_context_spec.rb | spec/integration/action/view_rendering/view_context_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / View rendering / View context", :app_integration do
subject(:context) {
# We capture the context during rendering via our view spies; see the view classes below
action.call("REQUEST_METHOD" => "GET", "QUERY_STRING" => "/mock_request")
action.view... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/view_rendering/paired_view_inference_spec.rb | spec/integration/action/view_rendering/paired_view_inference_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App action / View rendering / Paired view inference", :app_integration do
before do
module TestApp
class App < Hanami::App
end
end
Hanami.app.prepare
module TestApp
class Action < Hanami::Action
end
end
en... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/action/view_rendering/automatic_rendering_spec.rb | spec/integration/action/view_rendering/automatic_rendering_spec.rb | # frozen_string_literal: true
RSpec.describe "App action / View rendering / Automatic rendering", :app_integration do
it "Renders a view automatically, passing all params and exposures" do
within_app do
write "app/actions/profile/show.rb", <<~RUBY
module TestApp
module Actions
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/slices/slice_loading_spec.rb | spec/integration/slices/slice_loading_spec.rb | # frozen_string_literal: true
require "rack/test"
RSpec.describe "Slices / Slice loading", :app_integration, :aggregate_failures do
let(:app_modules) { %i[TestApp Admin Main] }
describe "loading specific slices with config.slices" do
describe "setup app" do
it "ignores any explicitly registered slices ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/slices/slice_configuration_spec.rb | spec/integration/slices/slice_configuration_spec.rb | # frozen_string_literal: true
require "stringio"
RSpec.describe "Slices / Slice configuration", :app_integration do
specify "Slices receive a copy of the app configuration, and can make distinct modifications" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/slices/external_slice_spec.rb | spec/integration/slices/external_slice_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Slices / External slices", :app_integration do
include Rack::Test::Methods
let(:app) { TestApp::App.app }
specify "External slices can be registered and used" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/slices/slice_registrations_spec.rb | spec/integration/slices/slice_registrations_spec.rb | # frozen_string_literal: true
RSpec.describe "Slice Registrations", :app_integration do
matcher :have_key do |name, value|
match do |slice|
slice.resolve(name) == value
end
end
specify "Registrations are loaded" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/slices/slice_routing_spec.rb | spec/integration/slices/slice_routing_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Slices / Slice routing", :app_integration do
include Rack::Test::Methods
let(:app) { Main::Slice.rack_app }
specify "Slices have a nil router when no routes are defined" do
with_tmp_directory(Dir.mktmpdir) do
write ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/operations/extension_spec.rb | spec/integration/operations/extension_spec.rb | # frozen_string_literal: true
require "dry/operation"
RSpec.describe "Operation / Extensions", :app_integration do
before do
@env = ENV.to_h
allow(Hanami::Env).to receive(:loaded?).and_return(false)
end
after { ENV.replace(@env) }
specify "Transaction interface is made available automatically" do
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/assets/assets_spec.rb | spec/integration/assets/assets_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Assets", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
let(:root) { make_tmp_directory }
before do
with_directory(root) do
write "config/app.rb", <<~RUBY
module TestApp
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/assets/cross_slice_assets_helpers_spec.rb | spec/integration/assets/cross_slice_assets_helpers_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Cross-slice assets via helpers", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
let(:root) { make_tmp_directory }
before do
with_directory(root) do
write "config/app.rb", <<~RUBY
m... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/assets/serve_static_assets_spec.rb | spec/integration/assets/serve_static_assets_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Serve Static Assets", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
let(:root) { make_tmp_directory }
let!(:env) { ENV.to_h }
before do
with_directory(root) do
write "config/app.rb", <<... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/rack_app/non_booted_rack_app_spec.rb | spec/integration/rack_app/non_booted_rack_app_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Running a Rack app for a non-booted app", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
it "lazy loads only the components required for any accessed routes" do
with_tmp_directory(Dir.mktmpdir) d... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/rack_app/middleware_spec.rb | spec/integration/rack_app/middleware_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Hanami web app", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
around do |example|
with_tmp_directory(Dir.mktmpdir, &example)
end
before do
module TestApp
module Middlewares
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/rack_app/body_parser_spec.rb | spec/integration/rack_app/body_parser_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Hanami web app", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
around do |example|
with_tmp_directory(Dir.mktmpdir, &example)
end
specify "Default body parser" do
write "config/app.rb",... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/rack_app/rack_app_spec.rb | spec/integration/rack_app/rack_app_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Hanami web app", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
specify "Hanami.app returns a rack builder" do
with_tmp_directory do
write "config/app.rb", <<~RUBY
require "hanami"
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/rack_app/method_override_spec.rb | spec/integration/rack_app/method_override_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Hanami web app: Method Override", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
around do |example|
with_tmp_directory(Dir.mktmpdir, &example)
end
context "enabled by default" do
before... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/slice_configuration_spec.rb | spec/integration/view/slice_configuration_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Slice configuration", :app_integration do
before do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::App
end
end
RUBY
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/views_spec.rb | spec/integration/view/views_spec.rb | # frozen_string_literal: true
RSpec.describe "Hanami view integration", :app_integration do
specify "Views take their configuration from their slice in which they are defined" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
cl... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/parts/default_rendering_spec.rb | spec/integration/view/parts/default_rendering_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Parts / Default rendering", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write "app/view.rb", <... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/helpers/part_helpers_spec.rb | spec/integration/view/helpers/part_helpers_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Helpers / Part helpers", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write "app/view.rb", <<~R... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/helpers/scope_helpers_spec.rb | spec/integration/view/helpers/scope_helpers_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Helpers / Scope helpers", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write "app/view.rb", <<~... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/helpers/form_helper_spec.rb | spec/integration/view/helpers/form_helper_spec.rb | # frozen_string_literal: true
require "rack/test"
require "stringio"
RSpec.describe "Helpers / FormHelper", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class Ap... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/helpers/user_defined_helpers/part_helpers_spec.rb | spec/integration/view/helpers/user_defined_helpers/part_helpers_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Helpers / User-defined helpers / Scope helpers", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
w... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/helpers/user_defined_helpers/scope_helpers_spec.rb | spec/integration/view/helpers/user_defined_helpers/scope_helpers_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Helpers / User-defined helpers / Scope helpers", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
w... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/inflector_spec.rb | spec/integration/view/config/inflector_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App view / Config / Inflector", :app_integration do
before do
module TestApp
class App < Hanami::App
config.root = "/test_app"
end
end
Hanami.app.instance_eval(&app_hook) if respond_to?(:app_hook)
Hanami.app.register... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/part_namespace_spec.rb | spec/integration/view/config/part_namespace_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App view / Config / Part namespace", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write ... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/paths_spec.rb | spec/integration/view/config/paths_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App view / Config / Paths", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write "app/view... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/default_context_spec.rb | spec/integration/view/config/default_context_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Config / Default context", :app_integration do
before do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write "app/view.... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/part_class_spec.rb | spec/integration/view/config/part_class_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Config / Part class", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write "app/view.rb", <<~RUBY... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/scope_class_spec.rb | spec/integration/view/config/scope_class_spec.rb | # frozen_string_literal: true
RSpec.describe "App view / Config / Scope class", :app_integration do
before do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write "app/view.rb",... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/scope_namespace_spec.rb | spec/integration/view/config/scope_namespace_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App view / Config / Scope namespace", :app_integration do
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestApp
class App < Hanami::App
end
end
RUBY
write... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/config/template_spec.rb | spec/integration/view/config/template_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App view / Config / Template", :app_integration do
before do
module TestApp
class App < Hanami::App
config.root = "/test_app"
end
end
Hanami.app.instance_eval(&app_hook) if respond_to?(:app_hook)
Hanami.app.register_... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/context/inflector_spec.rb | spec/integration/view/context/inflector_spec.rb | require "hanami"
RSpec.describe "App view / Context / Inflector", :app_integration do
before do
module TestApp
class App < Hanami::App
end
end
Hanami.prepare
module TestApp
module Views
class Context < Hanami::View::Context
end
end
end
end
let(:conte... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/context/request_spec.rb | spec/integration/view/context/request_spec.rb | require "hanami"
RSpec.describe "App view / Context / Request", :app_integration do
before do
module TestApp
class App < Hanami::App
end
end
Hanami.prepare
module TestApp
module Views
class Context < Hanami::View::Context
end
end
end
end
let(:context... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/context/assets_spec.rb | spec/integration/view/context/assets_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App view / Context / Assets", :app_integration do
subject(:context) { context_class.new }
let(:context_class) { TestApp::Views::Context }
before do
with_directory(make_tmp_directory) do
write "config/app.rb", <<~RUBY
module TestAp... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/view/context/routes_spec.rb | spec/integration/view/context/routes_spec.rb | # frozen_string_literal: true
require "hanami"
RSpec.describe "App view / Context / Routes", :app_integration do
it "accesses app routes" do
with_tmp_directory(Dir.mktmpdir) do
write "config/app.rb", <<~RUBY
require "hanami"
module TestApp
class App < Hanami::App
end
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/router/resource_routes_spec.rb | spec/integration/router/resource_routes_spec.rb | # frozen_string_literal: true
require "dry/inflector"
require "hanami/slice/router"
require "json"
RSpec.describe "Router / Resource routes" do
let(:router) { Hanami::Slice::Router.new(routes:, resolver:, inflector: Dry::Inflector.new) { } }
let(:resolver) { Hanami::Slice::Routing::Resolver.new(slice:) }
let(:... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/web/welcome_view_spec.rb | spec/integration/web/welcome_view_spec.rb | # frozen_string_literal: true
require "json"
require "rack/test"
RSpec.describe "Web / Welcome view", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
before do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~RUBY
require "hanami"
modul... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/web/render_detailed_errors_spec.rb | spec/integration/web/render_detailed_errors_spec.rb | # frozen_string_literal: true
require "json"
require "rack/test"
RSpec.describe "Web / Rendering detailed errors", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
before do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~RUBY
require "hanami"
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/web/render_errors_spec.rb | spec/integration/web/render_errors_spec.rb | # frozen_string_literal: true
require "json"
require "rack/test"
RSpec.describe "Web / Rendering errors", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
before do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~RUBY
require "hanami"
m... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/web/content_security_policy_nonce_spec.rb | spec/integration/web/content_security_policy_nonce_spec.rb | # frozen_string_literal: true
require "rack/test"
RSpec.describe "Web / Content security policy nonce", :app_integration do
include Rack::Test::Methods
let(:app) { Hanami.app }
before do
with_directory(@dir = make_tmp_directory) do
write "config/routes.rb", <<~RUBY
module TestApp
c... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/code_loading/loading_from_slice_spec.rb | spec/integration/code_loading/loading_from_slice_spec.rb | # frozen_string_literal: true
RSpec.describe "Code loading / Loading from slice directory", :app_integration do
before :context do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~'RUBY'
require "hanami"
module TestApp
class App < Hanami::App
end
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/code_loading/loading_from_lib_spec.rb | spec/integration/code_loading/loading_from_lib_spec.rb | # frozen_string_literal: true
RSpec.describe "Code loading / Loading from lib directory", :app_integration do
describe "default root" do
before :context do
with_directory(@dir = make_tmp_directory.realpath) do
write "config/app.rb", <<~'RUBY'
require "hanami"
module TestApp
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/integration/code_loading/loading_from_app_spec.rb | spec/integration/code_loading/loading_from_app_spec.rb | # frozen_string_literal: true
RSpec.describe "Code loading / Loading from app directory", :app_integration do
before :context do
with_directory(@dir = make_tmp_directory) do
write "config/app.rb", <<~'RUBY'
require "hanami"
module TestApp
class App < Hanami::App
end
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/unit/hanami/port_spec.rb | spec/unit/hanami/port_spec.rb | # frozen_string_literal: true
require "hanami/port"
RSpec.describe Hanami::Port do
context "Hanami::Port::DEFAULT" do
it "returns default value" do
expect(Hanami::Port::DEFAULT).to eq(2300)
end
end
context "Hanami::Port::ENV_VAR" do
it "returns default value" do
expect(Hanami::Port::ENV... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/unit/hanami/slice_name_spec.rb | spec/unit/hanami/slice_name_spec.rb | # frozen_string_literal: true
require "hanami/slice_name"
require "dry/inflector"
RSpec.describe Hanami::SliceName do
subject(:slice_name) { described_class.new(slice, inflector: -> { inflector }) }
let(:slice) { double(name: "Main::Slice") }
let(:inflector) { Dry::Inflector.new }
let(:slice_module) { Modul... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/unit/hanami/env_spec.rb | spec/unit/hanami/env_spec.rb | # frozen_string_literal: true
RSpec.describe Hanami, ".env" do
subject { described_class.env(e: env) }
context "HANAMI_ENV, APP_ENV and RACK_ENV in ENV" do
let(:env) { { "HANAMI_ENV" => "test", "APP_ENV" => "development", "RACK_ENV" => "production" } }
it "is the value of HANAMI_ENV" do
is_expected... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
hanami/hanami | https://github.com/hanami/hanami/blob/ccc7e5df285595191fb467729bb5ddc53f77f077/spec/unit/hanami/settings_spec.rb | spec/unit/hanami/settings_spec.rb | # frozen_string_literal: true
require "hanami/settings"
RSpec.describe Hanami::Settings do
describe "#initialize" do
it "uses values from the store when present" do
settings_class = Class.new(described_class) do
setting :database_url, default: "postgres://localhost/test_app_development"
end
... | ruby | MIT | ccc7e5df285595191fb467729bb5ddc53f77f077 | 2026-01-04T15:40:32.670663Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.