Sha256: fcdbd33085fcca758af7b67dc75b84463f482f6697730fa26fd0acf85636f3e1
Contents?: true
Size: 1.2 KB
Versions: 2
Compression:
Stored size: 1.2 KB
Contents
require 'spec_helper' module DistribBuilder describe Main do let(:opts) { %w(--option value) } it "does return nil if type argument is missing" do #expect( described_class.run ).to be_nil end it "does return nil if type argument is missing" do allow( described_class ).to receive(:duplicate_argv).and_return(['build']) #expect( described_class.run ).to be_nil end it "does call an instance of Builder class" do allow( described_class ).to receive(:duplicate_argv).and_return(['build'] + opts) allow_any_instance_of( Builder::Main ).to receive(:run) expect( Builder::Main ).to receive(:new). with(opts). and_return(Builder::Main.new(opts)) described_class.run end it "does call an instance of Versioner class" do allow( described_class ).to receive(:duplicate_argv).and_return(['version'] + opts) allow_any_instance_of( Versioner::Main ).to receive(:run) expect( Versioner::Main ).to receive(:new). with(opts). and_return(Versioner::Main.new(opts)) described_class.run end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
distrib_builder-0.0.3 | spec/lib/distrib_builder_spec.rb |
distrib_builder-0.0.2 | spec/lib/distrib_builder_spec.rb |