Sha256: 9a19651fe614f016e8b36fb8d1ba73456d06b53f864bf9fc79d9bee7c74fa354

Contents?: true

Size: 424 Bytes

Versions: 2

Compression:

Stored size: 424 Bytes

Contents

require "open3"
require "#{ENV['HOME']}/.ruby_learner/workshop/lib/workplace.rb"

RSpec.describe "STDIN-check" do
  it 'given 3, return "3.0\n9.0\n"' do
    allow(STDIN).to receive(:gets) { 3 }
    expect { standard_input() }.to output("3.0\n9.0\n").to_stdout
  end
  it 'given 8, return "8.0\n64.0\n"' do
    allow(STDIN).to receive(:gets) { 8 }
    expect { standard_input() }.to output("8.0\n64.0\n").to_stdout
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby_learner-1.1.14 questions/sequential_check/section_2/part_3/spec/workplace_spec.rb
ruby_learner-1.1.13 questions/sequential_check/section_2/part_3/spec/workplace_spec.rb