spec/integration/create_burndown_spec.rb in trollolo-0.0.6 vs spec/integration/create_burndown_spec.rb in trollolo-0.0.7
- old
+ new
@@ -1,8 +1,9 @@
require_relative "integration_spec_helper"
include GivenFilesystemSpecHelpers
+include CliTester
HELPER_SCRIPT = File.expand_path("../../../scripts/create_burndown.py", __FILE__)
describe "create_burndown.py" do
use_given_filesystem(keep_files: true)
@@ -10,48 +11,45 @@
it "creates burndown chart for sprint 23" do
@working_dir = given_directory do
given_file("burndown-data-23.yaml", from: "create_burndown_helper/burndown-data-23.yaml")
end
- cmd = "#{HELPER_SCRIPT} 23 --output=#{@working_dir} --no-head"
- run(cmd)
- assert_exit_status(0)
+ result = run_command(cmd: HELPER_SCRIPT, args: ["23", "--output=#{@working_dir}", "--no-head"])
+ expect(result).to exit_with_success("")
expect(File.join(@working_dir, "burndown-23.png")).
to be_same_image_as("create_burndown_helper/burndown-23.png")
end
it "creates burndown chart for sprint 31" do
@working_dir = given_directory do
given_file("burndown-data-31.yaml", from: "create_burndown_helper/burndown-data-31.yaml")
end
- cmd = "#{HELPER_SCRIPT} 31 --output=#{@working_dir} --no-head"
- run(cmd)
- assert_exit_status(0)
+ result = run_command(cmd: HELPER_SCRIPT, args: ["31", "--output=#{@working_dir}", "--no-head"])
+ expect(result).to exit_with_success("")
expect(File.join(@working_dir, "burndown-31.png")).
to be_same_image_as("create_burndown_helper/burndown-31.png")
end
it "creates burndown chart for sprint 35" do
@working_dir = given_directory do
given_file("burndown-data-35.yaml", from: "create_burndown_helper/burndown-data-35.yaml")
end
- cmd = "#{HELPER_SCRIPT} 35 --output=#{@working_dir} --no-head"
- run(cmd)
- assert_exit_status(0)
+ result = run_command(cmd: HELPER_SCRIPT, args: ["35", "--output=#{@working_dir}", "--no-head"])
+ expect(result).to exit_with_success("")
expect(File.join(@working_dir, "burndown-35.png")).
to be_same_image_as("create_burndown_helper/burndown-35.png")
end
it "creates burndown chart for sprint 8" do
@working_dir = given_directory do
given_file("burndown-data-08.yaml", from: "create_burndown_helper/burndown-data-08.yaml")
end
- cmd = "#{HELPER_SCRIPT} 08 --output=#{@working_dir} --no-tasks --with-fast-lane --no-head"
- run(cmd)
- assert_exit_status(0)
+ result = run_command(cmd: HELPER_SCRIPT,
+ args: ["08", "--output=#{@working_dir}", "--no-tasks", "--with-fast-lane", "--no-head"])
+ expect(result).to exit_with_success("")
expect(File.join(@working_dir, "burndown-08.png")).
to be_same_image_as("create_burndown_helper/burndown-08.png")
end
end