diff --git a/src/language/utils/OFStream.hpp b/src/language/utils/OFStream.hpp
index 589f0fe2720b5cdfb1d6e718cc11b14d1d93592c..8421906fca8746192b0d24730f7a731fe2640894 100644
--- a/src/language/utils/OFStream.hpp
+++ b/src/language/utils/OFStream.hpp
@@ -5,7 +5,7 @@
 
 #include <fstream>
 
-class OFStream : public OStream
+class OFStream final : public OStream
 {
  private:
   std::ofstream m_fstream;
@@ -13,7 +13,7 @@ class OFStream : public OStream
  public:
   OFStream(const std::string& filename);
 
-  OFStream()  = default;
+  OFStream()  = delete;
   ~OFStream() = default;
 };
 
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 56386d8d7c57292bce3794e016fa59b4f574c92e..714bb23bf8d077c62323d81aa29d12ef57f07cf4 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -115,6 +115,7 @@ add_executable (mpi_unit_tests
   test_ItemValue.cpp
   test_ItemValueUtils.cpp
   test_Messenger.cpp
+  test_OFStream.cpp
   test_Partitioner.cpp
   test_RandomEngine.cpp
   test_SubItemValuePerItem.cpp
diff --git a/tests/test_OFStream.cpp b/tests/test_OFStream.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6170ad55f58b169748c1f7a663018845daa3f91b
--- /dev/null
+++ b/tests/test_OFStream.cpp
@@ -0,0 +1,49 @@
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/matchers/catch_matchers_all.hpp>
+
+#include <language/utils/OFStream.hpp>
+#include <utils/Messenger.hpp>
+
+#include <filesystem>
+
+// clazy:excludeall=non-pod-global-static
+
+TEST_CASE("OFStream", "[language]")
+{
+  SECTION("ofstream")
+  {
+    const std::string basename = "ofstream_";
+    const std::string filename = basename + std::to_string(parallel::rank());
+
+    // Ensures that the file is closed after this line
+    std::make_shared<OFStream>(filename) << "foo" << 3 << " bar\n";
+
+    if (parallel::rank() == 0) {
+      REQUIRE(std::filesystem::is_regular_file(filename));
+
+      std::ifstream is(filename);
+
+      char file_content[10];
+      for (size_t i = 0; i < 10; ++i) {
+        char c = is.get();
+
+        file_content[i] = c;
+        if (c == '\n') {
+          file_content[i + 1] = '\0';
+          REQUIRE(i == 8);
+
+          c = is.get();
+          REQUIRE(is.eof());
+          break;
+        }
+      }
+
+      std::string content = file_content;
+      REQUIRE(content == "foo3 bar\n");
+
+      std::filesystem::remove(filename);
+    }
+
+    REQUIRE(not std::filesystem::exists(filename));
+  }
+}