Skip to content

Commit

Permalink
Fix for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
commjoen committed Feb 2, 2025
1 parent c2cac8d commit a1e93be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/test/e2e/cypress/integration/spoilers.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('Spoiler Tests', () => {
cy.dataCy(SpoilersPage.SPOILER_ANSWER).should('not.contain', 'Error Decrypting')
cy.dataCy(SpoilersPage.SPOILER_ANSWER).should('not.contain', 'Error Executing executable')
cy.dataCy(SpoilersPage.SPOILER_ANSWER).should('not.contain', 'Error reading secret')
cy.dataCy(SpoilersPage.SPOILER_ANSWER).should('not.contain', 'Error reading secret: this challenge only works from a container')
cy.dataCy(SpoilersPage.SPOILER_ANSWER).should('not.contain', 'Error, please add the dotnet binary to the challenges file.')
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.jruby.exceptions.Exception;
Expand All @@ -12,8 +13,8 @@
public class Challenge52Test {

@Test
void rightAnswerShouldSolveChallenge(@TempDir Path dir) throws Exception {
var testFile = new File(dir.toFile(), "yourkey.txt");
void rightAnswerShouldSolveChallenge(@TempDir Path dir) throws IOException {
var testFile = new File(dir.toFile(), "secret.txt");
var secret = "secretvalueWitFile";
Files.writeString(testFile.toPath(), secret);
var challenge = new Challenge52(dir.toString());
Expand Down

0 comments on commit a1e93be

Please sign in to comment.