Skip to content

Commit

Permalink
Fix snapshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
maltekliemann committed Aug 13, 2021
1 parent fa5caf8 commit fdcc657
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion resources/example_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define DRMOCK
#include <DrMock/Mock.h>
#include "/Users/malte/drmock-generator/resources/example.h"
#include "@PATH@"

namespace outer { namespace inner { namespace ns {

Expand Down
8 changes: 5 additions & 3 deletions tests/test_commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


def test_snapshot(script_runner):
PATH = "resources/example.h"
with tempfile.TemporaryDirectory() as tmpdir:
path = os.path.join(tmpdir, "example_mock.h")
ret = script_runner.run(
Expand All @@ -21,7 +22,7 @@ def test_snapshot(script_runner):
"Derived",
"--output-class",
"DerivedMock",
"resources/example.h",
PATH,
str(path),
"-n",
"ns",
Expand All @@ -31,8 +32,9 @@ def test_snapshot(script_runner):
)
with open(path, "r") as f:
result = f.read()
with open("resources/example_mock.h") as f:
expected = f.read()
with open("resources/example_mock.h") as f:
expected = f.read()
expected = expected.replace("@PATH@", os.path.abspath(PATH))
assert ret.success
assert result == expected

Expand Down

0 comments on commit fdcc657

Please sign in to comment.