Skip to content

Commit

Permalink
update test file
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohui-zhangxh committed Aug 8, 2023
1 parent 33ace7d commit 3b3ffa4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ class ConfigurationTest < ActiveSupport::TestCase
test "version from git committed" do
ENV.delete("VERSION")

@config.expects(:`).with("git rev-parse HEAD").returns("git-version")
@config.expects(:`).with("git rev-parse --short HEAD").returns("git-version")
Mrsk::Utils.expects(:uncommitted_changes).returns("")
assert_equal "git-version", @config.version
end

test "version from git uncommitted" do
ENV.delete("VERSION")

@config.expects(:`).with("git rev-parse HEAD").returns("git-version")
@config.expects(:`).with("git rev-parse --short HEAD").returns("git-version")
Mrsk::Utils.expects(:uncommitted_changes).returns("M file\n")
assert_match /^git-version_uncommitted_[0-9a-f]{16}$/, @config.version
assert_match /^git-version_[0-9a-f]{4}$/, @config.version
end

test "version from env" do
Expand Down

0 comments on commit 3b3ffa4

Please sign in to comment.