-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve testing by covering additional edge cases
* make sure the time is current is also tested * adjust file paths so they actually end up trying to get merged and not being ignored
- Loading branch information
Showing
5 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
RESULTSET_JSON_PATH = "coverage/.resultset.json" | ||
PATH_PLACE_HOLDER = "$$path" | ||
COMMAND_NAME = "RSpec Different Name to avoid overriding" | ||
|
||
Given "the paths in the old .resultset.json are adjusted to the current environment" do | ||
in_current_directory do | ||
resultset_json_content = File.read(RESULTSET_JSON_PATH) | ||
File.write(RESULTSET_JSON_PATH, resultset_json_content.gsub(PATH_PLACE_HOLDER, Dir.pwd)) | ||
end | ||
end | ||
|
||
Given "the timestamp in the .resultset.json is current" do | ||
in_current_directory do | ||
resultset_json = File.read(RESULTSET_JSON_PATH) | ||
resultset_hash = JSON.parse(resultset_json) | ||
resultset_hash[COMMAND_NAME]["time"] = Time.now.to_i | ||
File.write(RESULTSET_JSON_PATH, JSON.pretty_generate(resultset_hash)) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,6 @@ | |
@test_project_name = "old_coverage_json" | ||
end | ||
|
||
|
||
Before do | ||
this_dir = File.dirname(__FILE__) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters