diff --git a/spec/unit/run_spec.rb b/spec/unit/run_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/run_spec.rb
+++ b/spec/unit/run_spec.rb
@@ -108,6 +108,14 @@ RSpec.describe TTY::Command, '#run' do
     )
   end
 
+  it "times out after a specified period" do
+    output = StringIO.new
+    cmd = TTY::Command.new(output: output)
+    expect {
+      cmd.run("while test 1; do echo 'hello'; sleep 0.1; done", timeout: 0.1)
+    }.to raise_error(TTY::Command::ExitError)
+  end
+
   it "redirects STDOUT stream" do
     output = StringIO.new
     command = TTY::Command.new(output: output)
Test timeout option for run command.