Sha256: 78459c1fecc5cff1b29627c4e55e7b9094e0d9c4623f4a676e5067ffb29c4844

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

require 'spec_helper'

describe Octokit::Enterprise do
  describe 'hostname=' do
    let(:base_hostname) { 'git.enterprise.example.com' }

    before do
      Octokit::Enterprise.hostname = base_hostname
    end

    Octokit::Enterprise::CUSTOM_ENDPOINTS.each do |endpoint|
      context endpoint do
        let(:expected_hostname) do
          case endpoint
          when :web_endpoint
            base_hostname
          else
            subdomain = endpoint.to_s.split('_').first
            [subdomain, base_hostname].join('.')
          end
        end

        subject do
          URI.parse(
            Octokit::Client.new.send(endpoint)
          )
        end

        its(:hostname) do
          should == expected_hostname
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
octokit-enterprise-0.0.1 spec/octokit/enterprise_spec.rb