Sha256: 3ebc5fa427f47293da21b04383037b087648a60ddc30f2b9f59b8b5ebb3cbc7a
Contents?: true
Size: 1.52 KB
Versions: 1
Compression:
Stored size: 1.52 KB
Contents
require File.expand_path(File.dirname(__FILE__) + "/spec_helper.rb") module Vircs describe Virc do context "#use" do context "with args" do let(:args) { "foo" } it "saves the current config" do subject.should_receive(:check_for).with("foo") subject.should_receive(:unlink_current) subject.should_receive(:setup_links).with("foo") subject.should_receive(:save_current).with("foo") capture(:stdout) { subject.use(args) }.should == "" end it "saves the current configuration when files are present" do subject = Virc.new File.expand_path('examples', File.dirname(__FILE__)) subject.should_receive(:check_for).with("flinstone") subject.should_receive(:unlink_current) # subject.setup_links: is called but we want it to execute # but without actually creating symbolic links File.stub(:symlink) subject.should_receive(:save_current).with("flinstone") capture(:stdout) { subject.use("flinstone") }.should =~ /Added\s+\[.+\/bambam\]/ end it "raises an exception when the supplied folder is not present" do subject.stub_chain(:check_for).and_raise("KA-BOOM") expect { subject.use(args) }.to raise_error("KA-BOOM") end end context "without args" do it "shows usage when no args are provided" do capture(:stdout) { subject.use }.should =~ usage_pattern end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vircs-1.0.2 | spec/use_spec.rb |