Sha256: 5f590a58b1020a9ab8488edb9e460e832047419306d77e6a6c7dd9ddde30201d

Contents?: true

Size: 717 Bytes

Versions: 6

Compression:

Stored size: 717 Bytes

Contents

require "spec_helper"

describe SimControl::Scenario do
  it "generates options in -- syntax" do
    scenario = SimControl::Scenario.new foo: "bar", baz: 1
    expect(scenario.options).to eq("--foo bar --baz 1")
  end

  it "generates commands by concatenating" do
    scenario = SimControl::Scenario.new "foo", "bar"
    expect(scenario.commands).to eq("foo bar")
  end

  it "generates the complete arguments string" do
    scenario = SimControl::Scenario.new "foo", "bar", baz: "1", qux: 2
    expect(scenario.args).to eq("--baz 1 --qux 2 foo bar")
  end

  it "merges options passed to args in the options" do
    scenario = SimControl::Scenario.new
    expect(scenario.args(seed: 1)).to eq("--seed 1")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
SimControl-0.1.10 spec/scenario_spec.rb
SimControl-0.1.9 spec/scenario_spec.rb
SimControl-0.1.8 spec/scenario_spec.rb
SimControl-0.1.7 spec/scenario_spec.rb
SimControl-0.1.6 spec/scenario_spec.rb
SimControl-0.1.5 spec/scenario_spec.rb