Try:

```ruby
test do
    system "echo A B | \"#{bin}/pk\" 2"
  end
```

Which works like:

```
Testing pk
==> echo A B | "/usr/local/Cellar/pk/1.0.1/bin/pk" 2
echo A B | "/usr/local/Cellar/pk/1.0.1/bin/pk" 2 
B
```