Sha256: 338fadd272652796c230a717d07011a775a3281a336f1e4a7c59619c3008ca9f
Contents?: true
Size: 986 Bytes
Versions: 47
Compression:
Stored size: 986 Bytes
Contents
require 'spec_helper' require 'middleman-core/preview_server/server_hostname' RSpec.describe Middleman::PreviewServer::ServerHostname do subject(:hostname) { described_class.new(string) } let(:string) { 'www.example.com' } describe '#to_s' do context 'when hostname' do it { expect(hostname.to_s).to eq string } end context 'when ipv4' do let(:string) { '127.0.0.1' } it { expect(hostname.to_s).to eq string } end context 'when ipv6' do let(:string) { '2607:f700:8000:12e:b3d9:1cba:b52:aa1b' } it { expect(hostname.to_s).to eq string } end end describe '#to_browser' do context 'when hostname' do it { expect(hostname.to_browser).to eq string } end context 'when ipv4' do let(:string) { '127.0.0.1' } it { expect(hostname.to_browser).to eq string } end context 'when ipv6' do let(:string) { '::1' } it { expect(hostname.to_browser).to eq string } end end end
Version data entries
47 entries across 47 versions & 3 rubygems