Advertisement
Guest User

Untitled

a guest
Jan 18th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. require 'spec_helper'
  2. require 'cronenberg/config'
  3. require 'rspec/mocks/standalone'
  4.  
  5. describe Cronenberg::Config do
  6. context "#initialize" do
  7. let(:config_hash) do
  8. {
  9. host: 'vsphere.pizza.com',
  10. user: 'pizzamaster5000',
  11. password: 'pizzapass',
  12. }
  13. end
  14.  
  15. context "with no env variables or config file" do
  16. it "should raise a RunTime error" do
  17. expect{ Cronenberg::Config.new }.to raise_error(RuntimeError)
  18. end
  19. end
  20.  
  21. context "with a valid configuration hash" do
  22. before do
  23. expect(Cronenberg::Config).to receive(:process_environment_variables).and_return config_hash
  24. end
  25. it "returns valid config items" do
  26. config = Cronenberg::Config.new
  27. end
  28. end
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement