Sha256: 7697ce45247703526010c22579bb329b04178c095dbf86b8f1a60559570582ec

Contents?: true

Size: 1.37 KB

Versions: 24

Compression:

Stored size: 1.37 KB

Contents

require 'spec_helper'
require 'stringio'

module Kernel

  def capture_stdout
    out = StringIO.new
    $stdout = out
    yield
    return out.string
  ensure
    $stdout = STDOUT
  end

end

describe Softcover::Commands::Check do

  subject(:check) do
    capture_stdout do
      Softcover::Commands::Check.check_dependencies!
    end
  end

  it { should match /all dependencies satisfied/i }

  describe "missing dependencies" do
    before do
      Softcover::Commands::Check.dependency_labels.each do |label|
        Softcover::Commands::Check.stub(:present?).with(label).and_return(false)
      end
    end

    it { should match /Checking for LaTeX.*Missing/ }
    it { should match /Checking for PhantomJS.*Missing/ }
    it { should match /Checking for Inkscape.*Missing/ }
    it { should match /Checking for Calibre.*Missing/ }
    it { should match /Checking for Java.*Missing/ }
    it { should match /Checking for EpubCheck.*Missing/ }
    it { should match /Checking for ImageMagick.*Missing/ }
    it { should match /Checking for Node\.js.*Missing/ }

    it { should match /Missing dependencies:/ }
    it { should match /LaTeX/ }
    it { should match /PhantomJS/ }
    it { should match /Inkscape/ }
    it { should match /Calibre/ }
    it { should match /Java/ }
    it { should match /EpubCheck/ }
    it { should match /ImageMagick/ }
    it { should match /Node\.js/ }
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
softcover-1.10.5 spec/commands/check_spec.rb
softcover-1.10.4 spec/commands/check_spec.rb
softcover-1.10.3 spec/commands/check_spec.rb
softcover-1.10.2 spec/commands/check_spec.rb
softcover-1.10.1 spec/commands/check_spec.rb
softcover-1.10.0 spec/commands/check_spec.rb
softcover-1.9.1 spec/commands/check_spec.rb
softcover-1.9.0 spec/commands/check_spec.rb
softcover-1.8.3 spec/commands/check_spec.rb
softcover-1.8.2 spec/commands/check_spec.rb
softcover-1.8.1 spec/commands/check_spec.rb
softcover-1.8.0 spec/commands/check_spec.rb
softcover-1.7.5 spec/commands/check_spec.rb
softcover-1.7.4 spec/commands/check_spec.rb
softcover-1.7.3 spec/commands/check_spec.rb
softcover-1.7.2 spec/commands/check_spec.rb
softcover-1.7.1 spec/commands/check_spec.rb
softcover-1.7.0 spec/commands/check_spec.rb
softcover-1.6.5 spec/commands/check_spec.rb
softcover-1.6.4 spec/commands/check_spec.rb