35 lines
727 B
Ruby
35 lines
727 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "stringio"
|
|
require_relative "test_helper"
|
|
|
|
class WizardTest < Minitest::Test
|
|
def test_minimal_new_case_flow_and_confirmation
|
|
input = StringIO.new(
|
|
"Demo Case\n" \
|
|
"\n" \
|
|
"1\n" \
|
|
"1\n" \
|
|
"\n" \
|
|
"n\n" \
|
|
"n\n" \
|
|
"n\n" \
|
|
"1\n" \
|
|
"n\n" \
|
|
"n\n" \
|
|
"n\n" \
|
|
"n\n" \
|
|
"y\n"
|
|
)
|
|
output = StringIO.new
|
|
wizard = FeatherCaseWizard::Wizard.new(ui: HighLine.new(input, output))
|
|
|
|
config = wizard.create
|
|
|
|
assert wizard.confirm_build(config)
|
|
assert_equal "demo-case", config.slug
|
|
assert_equal ["3mf"], config.outputs["formats"]
|
|
assert_equal %w[body lid], config.printable_parts
|
|
end
|
|
end
|