|
17 | 17 | expect(nvim.filetype).to eq("NeogitLogView") |
18 | 18 | end |
19 | 19 |
|
20 | | - it "can yank OID" do |
| 20 | + it "can open Yank popup" do |
21 | 21 | nvim.keys("Y") |
22 | | - expect(nvim.screen.last.strip).to match(/\A[a-f0-9]{40}\z/) |
| 22 | + expect(nvim.filetype).to eq("NeogitPopup") |
| 23 | + end |
| 24 | + |
| 25 | + it "can yank oid" do |
| 26 | + nvim.keys("YY") |
| 27 | + yank = nvim.cmd("echo @*").first |
| 28 | + expect(yank).to match(/[0-9a-f]{40}/) |
| 29 | + end |
| 30 | + |
| 31 | + it "can yank author" do |
| 32 | + nvim.keys("Ya") |
| 33 | + yank = nvim.cmd("echo @*").first |
| 34 | + expect(yank).to eq("tester <test@example.com>") |
| 35 | + end |
| 36 | + |
| 37 | + it "can yank subject" do |
| 38 | + nvim.keys("Ys") |
| 39 | + yank = nvim.cmd("echo @*").first |
| 40 | + expect(yank).to eq("Initial commit") |
| 41 | + end |
| 42 | + |
| 43 | + it "can yank message" do |
| 44 | + nvim.keys("Ym") |
| 45 | + yank = nvim.cmd("echo @*") |
| 46 | + expect(yank).to contain_exactly("Initial commit\n", "commit message") |
| 47 | + end |
| 48 | + |
| 49 | + it "can yank body" do |
| 50 | + nvim.keys("Yb") |
| 51 | + yank = nvim.cmd("echo @*").first |
| 52 | + expect(yank).to eq("commit message") |
| 53 | + end |
| 54 | + |
| 55 | + it "can yank diff" do |
| 56 | + nvim.keys("Yd") |
| 57 | + yank = nvim.cmd("echo @*") |
| 58 | + expect(yank).to contain_exactly("@@ -0,0 +1 @@\n", "+hello, world") |
| 59 | + end |
| 60 | + |
| 61 | + it "can yank tag" do |
| 62 | + git.add_tag("test-tag", "HEAD") |
| 63 | + nvim.keys("Yt") |
| 64 | + yank = nvim.cmd("echo @*").first |
| 65 | + expect(yank).to eq("test-tag") |
| 66 | + end |
| 67 | + |
| 68 | + it "can yank tags" do |
| 69 | + git.add_tag("test-tag-a", "HEAD") |
| 70 | + git.add_tag("test-tag-b", "HEAD") |
| 71 | + nvim.keys("Yt") |
| 72 | + yank = nvim.cmd("echo @*").first |
| 73 | + expect(yank).to eq("test-tag-a, test-tag-b") |
23 | 74 | end |
24 | 75 |
|
25 | 76 | it "can open the bisect popup" do |
|
0 commit comments