Sha256: f350ab01d7d5fb90e3bc88a8a5fc9540602837969cf617cb5e651ec6c60d6d83

Contents?: true

Size: 546 Bytes

Versions: 10

Compression:

Stored size: 546 Bytes

Contents

require "open3"

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby_learner-1.2.0 contents/questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.15 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.14 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.13 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.11 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.10 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.9 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.8 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.7 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb
ruby_learner-1.1.6 questions/sequential_check/section_6/part_2/spec/workplace_spec.rb