Sha256: 2bff13ddf1b864ee8d91b33fae82cf1ab7ca4fb42dc32566b39fe54b07d604f1

Contents?: true

Size: 428 Bytes

Versions: 2

Compression:

Stored size: 428 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.2.0 contents/questions/sequential_check/section_2/part_3/spec/workplace_spec.rb
ruby_learner-1.1.15 questions/sequential_check/section_2/part_3/spec/workplace_spec.rb