Sha256: d4cc51eb87609b0e20e328e8fbd051de6296a6259a0ef132929883caaaa4a815

Contents?: true

Size: 745 Bytes

Versions: 4

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

require "hanami/configuration"
require "uri"

RSpec.describe Hanami::Configuration, "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

4 entries across 4 versions & 1 rubygems

Version Path
hanami-2.0.0.beta3 spec/unit/hanami/configuration/base_url_spec.rb
hanami-2.0.0.beta2 spec/unit/hanami/configuration/base_url_spec.rb
hanami-2.0.0.beta1.1 spec/unit/hanami/configuration/base_url_spec.rb
hanami-2.0.0.beta1 spec/unit/hanami/configuration/base_url_spec.rb