You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kubsu-sm5-ruby/lab1/spec/spec_02.rb

16 lines
535 B

require_relative '../src/02_user_interface.rb'
RSpec.describe "Main" do
before do
allow(STDIN).to receive(:gets).and_return("ruby\n")
end
it "greets the user and checks Ruby as language" do
expect { main() }.to output("Hello my catgirl test_user! \nWhat is your love language?\nruby\nc++\npy\nПодлиза \n").to_stdout
end
it "handles unknown language input" do
allow(STDIN).to receive(:gets).and_return("java\n")
expect { main() }.to output(/Неизвестный язык: java/).to_stdout
end
end