import Quick
import Nimble
@testable import GrimoireKit

final class FileSpec: QuickSpec {
  override func spec() {
    describe("read") {
      context("when file path is faulty") {
        let path = "Sources /Commands/Help.swift"

        it("throws the correct error") {
          expect { try File.read(path) }.to(throwError { error in
            let expected = "The file “Help.swift” couldn’t be opened because there is no such file."
            expect(error.localizedDescription) == expected
          })
        }
      }

      context("when file path is valid") {
        let path = Fixture.path("FileSpecFixture.txt")

        it("fetch the correct file") {
          expect { try File.read(path) } == "some text content\n"
        }
      }
    }
  }
}

import Quick
import Nimble
@testable import GrimoireKit

final class FileSpec: QuickSpec {
  override func spec() {
    describe("read") {
      context("when file path is faulty") {
        let path = "Sources /Commands/Help.swift"

        it("throws the correct error") {
          expect { try File.read(path) }.to(throwError { error in
            expect(error.localizedDescription) == "The file “Help.swift” couldn’t be opened because there is no such file."
          })
        }
      }

      context("when file path is valid") {
        let path = Fixture.path("FileSpecFixture.txt")

        it("fetch the correct file") {
          expect { try File.read(path) } == "some text content\n"
        }
      }
    }
  }
}

--- 
+++ 
@@ -10,7 +10,8 @@
 
         it("throws the correct error") {
           expect { try File.read(path) }.to(throwError { error in
-            expect(error.localizedDescription) == "The file “Help.swift” couldn’t be opened because there is no such file."
+            let expected = "The file “Help.swift” couldn’t be opened because there is no such file."
+            expect(error.localizedDescription) == expected
           })
         }
       }
Fix line length linter warning
