Sha256: 22a37b022f2ea9593dd3f121ff765dde19a7bcbc36de849bea13de5d15c7ac61
Contents?: true
Size: 1.3 KB
Versions: 1
Compression:
Stored size: 1.3 KB
Contents
require 'spec_helper' require 'puppet-herald' describe PuppetHerald, '.relative_dir' do let(:thisfile) { File.realpath(__FILE__) } context 'on directory "."' do subject { PuppetHerald.relative_dir '.' } it do subject.should_not be_nil end it 'should give a common path' do thisfile.should include(subject) end it do thisfile.gsub(subject, '').should eq('/spec/unit/puppet-herald_spec.rb') end end context 'on directory "lib/puppet-herald/public"' do subject { PuppetHerald.relative_dir 'lib/puppet-herald/public' } it { Pathname.new(File.join(subject, 'app.js')).should be_file } end end describe PuppetHerald do after :each do ENV.delete 'PUPPET_HERALD_ENV' end context 'on unset environment variable' do before :each do ENV.delete 'PUPPET_HERALD_ENV' end describe '.environment' do it { subject::environment.should eq(:production) } end describe '.is_in_prod?' do it { subject.should be_is_in_prod } end end context 'on environment variable set to dev' do before :each do ENV['PUPPET_HERALD_ENV'] = 'dev' end describe '.environment' do it { subject::environment.should eq(:dev) } end describe '.is_in_prod?' do it { subject.should be_is_in_dev } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
puppet-herald-0.1.1 | spec/unit/puppet-herald_spec.rb |