Sha256: 886381912b48d0cfbcb661a257ea8dc0e654247daaf479fe7497ae59fccae792

Contents?: true

Size: 531 Bytes

Versions: 6

Compression:

Stored size: 531 Bytes

Contents

require "spec_helper"

describe Kitabu::Cli do
  context "while running new" do
    context "when all params are valid" do
      before do
        capture(:stdout){
          Kitabu::Cli.start(["new", tmpdir.join("mybook").to_s])
        }
      end

      it_behaves_like "e-book"
    end

    it "exits with status 1 when no path is provided" do
      expect(->{
        capture(:stderr){ Kitabu::Cli.start(["new"]) }
      }).to exit_with_code(1)

      expect(File).not_to be_directory(tmpdir.join("mybook"))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kitabu-2.1.0 spec/kitabu/cli/new_spec.rb
kitabu-2.0.4 spec/kitabu/cli/new_spec.rb
kitabu-2.0.3 spec/kitabu/cli/new_spec.rb
kitabu-2.0.2 spec/kitabu/cli/new_spec.rb
kitabu-2.0.1 spec/kitabu/cli/new_spec.rb
kitabu-2.0.0 spec/kitabu/cli/new_spec.rb