Print Function Tests
Grading Tests:
require 'rspec'
require 'stringio'
require '/usercode/example'
RSpec.describe "CodingRoomsUnitTests" do
describe "Run prints_name() with 'Jane'" do
it "expects output to be 'Hello, Jane!'" do
expect{prints_name("Jane")}.to output("Hello, Jane!\n").to_stdout
end
end
describe "Run prints_name() with 'Fred'" do
it "expects output to be 'Hello, Fred!'" do
expect{prints_name("Fred")}.to output("Hello, Fred!\n").to_stdout
end
end
end
Sample Solution:
Last updated
Was this helpful?