Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test.Mockery.Directory.touch fails on MacOS #11

Open
marsam opened this issue Jul 6, 2020 · 1 comment
Open

Test.Mockery.Directory.touch fails on MacOS #11

marsam opened this issue Jul 6, 2020 · 1 comment

Comments

@marsam
Copy link

marsam commented Jul 6, 2020

IIUC it's because darwin does not have subsecond resolution

Preprocessing test suite 'spec' for mockery-0.3.5..
Building test suite 'spec' for mockery-0.3.5..
[1 of 4] Compiling Test.Mockery.DirectorySpec ( test/Test/Mockery/DirectorySpec.hs, dist/build/spec/spec-tmp/Test/Mockery/DirectorySpec.o )
[2 of 4] Compiling Test.Mockery.EnvironmentSpec ( test/Test/Mockery/EnvironmentSpec.hs, dist/build/spec/spec-tmp/Test/Mockery/EnvironmentSpec.o )
[3 of 4] Compiling Test.Mockery.LoggingSpec ( test/Test/Mockery/LoggingSpec.hs, dist/build/spec/spec-tmp/Test/Mockery/LoggingSpec.o )
[4 of 4] Compiling Main             ( test/Spec.hs, dist/build/spec/spec-tmp/Main.o )
Linking dist/build/spec/spec ...
running tests
Running 1 test suites...
Test suite spec: RUNNING...
Test.Mockery.Directory
  withFile
    creates a temporary file with the given contents
  touch
    creates an empty file
    creates any missing directories
    when file already exists
      updates modification time FAILED [1]
      does not modify file content
Test.Mockery.Environment
  withEnvironment
    runs the given action within the specified environment
    restores the original environment
  withModifiedEnvironment
    runs the given action within a modified environment
    restores the original environment
Test.Mockery.Logging
  captureLogs
    returns all log messages of an action
    restores the original log sink
Failures:
  test/Test/Mockery/DirectorySpec.hs:42:13:
  1) Test.Mockery.Directory.touch, when file already exists, updates modification time
       predicate failed on: 2020-07-06 08:40:20 UTC
  To rerun use: --match "/Test.Mockery.Directory/touch/when file already exists/updates modification time/"
Randomized with seed 298994622
Finished in 0.0303 seconds
11 examples, 1 failure
Test suite spec: FAIL
Test suite logged to: dist/test/mockery-0.3.5-spec.log
0 of 1 test suites (0 of 1 test cases) passed.
@sol
Copy link
Member

sol commented Nov 23, 2021

@marsam only the test is failing, right? touch is still working as intended, or isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants