Sha256: 131b002bcbc04cd26818169366654b37a0ead30d07e68635e68d610bc76084fe

Contents?: true

Size: 731 Bytes

Versions: 18

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

require "hanami/config"
require "uri"

RSpec.describe Hanami::Config, "base_url" do
  subject(:config) { described_class.new(app_name: app_name, env: :development) }
  let(:app_name) { "MyApp::app" }

  it "defaults to a URI of 'http://0.0.0.0:2300'" do
    expect(config.base_url).to eq URI("http://0.0.0.0:2300")
  end

  it "can be changed to another URI via a string" do
    expect { config.base_url = "http://example.com" }
      .to change { config.base_url }
      .to(URI("http://example.com"))
  end

  it "can be changed to another URI object" do
    expect { config.base_url = URI("http://example.com") }
      .to change { config.base_url }
      .to(URI("http://example.com"))
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hanami-2.2.1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.2.0 spec/unit/hanami/config/base_url_spec.rb
hanami-2.2.0.rc1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.2.0.beta2 spec/unit/hanami/config/base_url_spec.rb
hanami-2.2.0.beta1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.1.0 spec/unit/hanami/config/base_url_spec.rb
hanami-2.1.0.rc3 spec/unit/hanami/config/base_url_spec.rb
hanami-2.1.0.rc2 spec/unit/hanami/config/base_url_spec.rb
hanami-2.1.0.rc1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.1.0.beta2.1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.1.0.beta2 spec/unit/hanami/config/base_url_spec.rb
hanami-2.1.0.beta1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.0.3 spec/unit/hanami/config/base_url_spec.rb
hanami-2.0.2 spec/unit/hanami/config/base_url_spec.rb
hanami-2.0.1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.0.0 spec/unit/hanami/config/base_url_spec.rb
hanami-2.0.0.rc1 spec/unit/hanami/config/base_url_spec.rb
hanami-2.0.0.beta4 spec/unit/hanami/config/base_url_spec.rb