File: test_command.rb

package info (click to toggle)
jekyll 4.4.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,488 kB
  • sloc: ruby: 16,736; javascript: 1,455; sh: 216; xml: 29; makefile: 9
file content (26 lines) | stat: -rw-r--r-- 680 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require "helper"

class TestCommand < JekyllUnitTest
  context "when calling .add_build_options" do
    should "add common options" do
      cmd = Object.new
      mocks_expect(cmd).to receive(:option).at_least(:once)
      Command.add_build_options(cmd)
    end
  end

  context "when calling .process_site" do
    context "when fatal error occurs" do
      should "exit with non-zero error code" do
        site = Object.new
        def site.process
          raise Jekyll::Errors::FatalException
        end
        error = assert_raises(SystemExit) { Command.process_site(site) }
        refute_equal 0, error.status
      end
    end
  end
end