Sha256: 415ffb05c62f981bf23f9c7a0e6c890773066aee22aec2f0c7bb653a11d84e59

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

require_relative '../spec_helper.rb'
require 'ogre'

VCR.configure do |config|
  config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
  config.hook_into :webmock

  # remove sensitive authentication information from the recording
  config.before_record do |interaction|
    headers = interaction.request.headers
    headers.keys
      .select { |k| k =~ /^X-Ops-(Authorization-|Content-Hash)/ }
      .each { |header| headers[header] = Array("{{#{header}}}") }
    headers['X-Ops-Userid'] = 'pivotal'
  end
end

describe Ogre::OrgDelete do
  it 'should delete org' do
    args = %w(my-org-name -f) + DEFAULTS
    response = "'my-org-name' org has been deleted.\n"
    VCR.use_cassette('org-delete') do
      expect { Ogre::OrgDelete.start(args) }.to output(response).to_stdout
    end
  end

  it 'should fail org doesnt exist' do
    args = %w(my-nonexistent-org -f) + DEFAULTS
    response = "my-nonexistent-org org does not exist\n"
    VCR.use_cassette('org-delete-no-org') do
      expect { Ogre::OrgDelete.start(args) }.to output(response).to_stdout
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ogre-0.1.5 spec/ogre/org-delete_spec.rb
ogre-0.1.4 spec/ogre/org-delete_spec.rb
ogre-0.1.3 spec/ogre/org-delete_spec.rb
ogre-0.1.2 spec/ogre/org-delete_spec.rb
ogre-0.1.1 spec/ogre/org-delete_spec.rb
ogre-0.1.0 spec/ogre/org-delete_spec.rb