Sha256: 52d4814cc494b634c96130309085f4c4a581ca6954da63fa7cc6d6e694e2a5fa

Contents?: true

Size: 566 Bytes

Versions: 19

Compression:

Stored size: 566 Bytes

Contents

require "open3"

RSpec.describe "ARGV-check" do
  it 'given 1 4, return "5\n-3\n4\n0\n"' do
    workshop = "#{ENV['HOME']}/.ruby_learner/workshop"
    stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb 1 4")
    expect { puts stdout }.to output("5\n-3\n4\n0\n").to_stdout
  end
  it 'given 20 4, return "24\n16\n80\n5\n"' do
    workshop = "#{ENV['HOME']}/.ruby_learner/workshop"
    stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb 20 4")
    expect { puts stdout }.to output("24\n16\n80\n5\n").to_stdout
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ruby_learner-1.2.9 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.8 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.7 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.6 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.5 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.4 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.3 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.2 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.1 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.2.0 contents/questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.15 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.14 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.13 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.11 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.10 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.9 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.8 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.7 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb
ruby_learner-1.1.6 questions/sequential_check/section_2/part_2/spec/workplace_spec.rb