Skip to content

Commit

Permalink
Fix some intermittent test failures due to Array order.
Browse files Browse the repository at this point in the history
  • Loading branch information
jish committed Dec 10, 2014
1 parent 4a2a3ff commit fd371b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit/pre-commit/utils/staged_files_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@
it "sets staged files from list" do
subject.staged_files.must_equal([])
subject.set_staged_files("some_file", "another_file")
subject.staged_files.must_equal(["some_file", "another_file"])
subject.staged_files.sort.must_equal(["some_file", "another_file"].sort)
end

it "sets staged files - all" do
subject.staged_files.must_equal([])
write("something.rb", "")
write("file.rb", "")
subject.set_staged_files(:all)
subject.staged_files.must_equal(["file.rb", "something.rb"])
subject.staged_files.sort.must_equal(["file.rb", "something.rb"].sort)
end

it "sets staged files - git" do
Expand All @@ -112,7 +112,7 @@
subject.staged_files = nil
subject.set_staged_files()
write("not_git.rb", "")
subject.staged_files.must_equal(["file.rb", "something.rb"])
subject.staged_files.sort.must_equal(["file.rb", "something.rb"].sort)
end

it "sets staged files - git all" do
Expand All @@ -122,7 +122,7 @@
system("git", "add", "-A")
subject.set_staged_files(:git)
write("not_git.rb", "")
subject.staged_files.must_equal(["file.rb", "something.rb"])
subject.staged_files.sort.must_equal(["file.rb", "something.rb"].sort)
end

end
Expand Down

0 comments on commit fd371b0

Please sign in to comment.