Sha256: 5511de6d6513106096c453c8f1fdff084c7c25e103640688f52f94ce8b824795

Contents?: true

Size: 596 Bytes

Versions: 19

Compression:

Stored size: 596 Bytes

Contents

require "open3"

RSpec.describe "ARGV-check" do
  it 'given 0 3 2 0 4, return "0\n3\n2\n0\n4\n"' do
    workshop = "#{ENV['HOME']}/.ruby_learner/workshop"
    stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb 0 3 2 0 4")
    expect { puts stdout }.to output("0\n3\n2\n0\n4\n").to_stdout
  end
  it 'given 10 0 0 2 1, return "10\n0\n0\n2\n1\n"' do
    workshop = "#{ENV['HOME']}/.ruby_learner/workshop"
    stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb 10 0 0 2 1")
    expect { puts stdout }.to output("10\n0\n0\n2\n1\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_1/spec/workplace_spec.rb
ruby_learner-1.2.8 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.7 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.6 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.5 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.4 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.3 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.2 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.1 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.2.0 contents/questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.15 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.14 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.13 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.11 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.10 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.9 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.8 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.7 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb
ruby_learner-1.1.6 questions/sequential_check/section_2/part_1/spec/workplace_spec.rb