File: puppet_forge_spec.rb

package info (click to toggle)
ruby-puppet-forge 5.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,196 kB
  • sloc: ruby: 2,397; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'
require 'uri'

RSpec.describe PuppetForge do
  describe 'host attribute' do
    after(:each) do
      PuppetForge.host = PuppetForge::DEFAULT_FORGE_HOST
    end

    it 'should add a trailing slash if not present' do
      PuppetForge.host = 'http://example.com'

      expect(PuppetForge.host[-1,1]).to eq '/'
    end

    it 'should coerce non-String values if possible' do
      PuppetForge.host = URI.parse('http://example.com')

      expect(PuppetForge.host).to be_a String
      expect(PuppetForge.host[-1,1]).to eq '/'
    end
  end
end