parent
b569973b38
commit
c359fd755b
@ -0,0 +1,16 @@
|
|||||||
|
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
|
Loading…
Reference in new issue