git_presenter 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec6e73263bc7b7fe3385a30fefd9473631fd9a2015182f73c437f832296df9ea
4
- data.tar.gz: 01c7a2b97c61f48a440b7489019742cbaf1c5da68e1bc084ff9e5a30741e51f1
3
+ metadata.gz: 16d1088ab5afeafb7357fb67a07d0b80c29715b75f0e90ba7fcc549f58cdeb84
4
+ data.tar.gz: fe4948246f729b01c8678e11f03f8bdbd979b3988d896edd7142c35dd3c23ec8
5
5
  SHA512:
6
- metadata.gz: fc2b81fa4219096831ec3b6e79d4a5829d9385de50e4883aea10e3af971965402231e0a13ec90f485377bd9860b94cf4bfe7378a0962bc10121765d6868479fe
7
- data.tar.gz: 353bca888c8f73082cf757068d582f8148122b87838c3ef7986b979b2573dbece0e42bd95de3b5c5c332bf0401a27a2c554459b358cc2fc285a3bb0ec97c02f8
6
+ metadata.gz: ab27a51ae79c16e0dc42775ecec088f135b405864487e44dcb01a35345711374e4614a5b9d3a83aac5bdd5cc1ce57f358fa48cf6bff9d8c1e3f484433f6cdbf0
7
+ data.tar.gz: 9ccf1f24f2d908b2fb1b98b4936a027cae95f29d1f933a36b3df22e9bab20574e0e78a434f4d5ff4adfa185f6540e2bee13056694ca79cb04926759b59c7ba24
data/Gemfile CHANGED
@@ -3,14 +3,14 @@ source "http://rubygems.org"
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
  #
6
- gem "git"
7
- gem 'launchy', '~> 2.5'
6
+ gem "git", "1.8.1"
7
+ gem 'launchy', "2.5.0"
8
8
 
9
9
  # Add dependencies to develop your gem here.
10
10
  # Include everything needed to run rake, tests, features, etc.
11
11
  group :development do
12
- gem "pry"
13
- gem "rspec", "~> 2.7"
14
- gem "bundler"
15
- gem 'jeweler', '~> 2.3'
12
+ gem "pry", "0.14.1"
13
+ gem "rspec", "3.10.0"
14
+ gem "bundler", "2.2.3"
15
+ gem 'jeweler', "2.3.5"
16
16
  end
data/Gemfile.lock CHANGED
@@ -10,7 +10,7 @@ GEM
10
10
  diff-lcs (1.4.4)
11
11
  faraday (0.9.2)
12
12
  multipart-post (>= 1.2, < 3)
13
- ffi (1.14.2-java)
13
+ ffi (1.15.0-java)
14
14
  git (1.8.1)
15
15
  rchardet (~> 1.8)
16
16
  github_api (0.11.3)
@@ -35,7 +35,7 @@ GEM
35
35
  rake
36
36
  rdoc
37
37
  semver2
38
- jwt (2.2.2)
38
+ jwt (2.2.3)
39
39
  launchy (2.5.0)
40
40
  addressable (~> 2.7)
41
41
  method_source (1.0.0)
@@ -46,16 +46,16 @@ GEM
46
46
  nokogiri (1.6.8.1)
47
47
  mini_portile2 (~> 2.1.0)
48
48
  nokogiri (1.6.8.1-java)
49
- oauth2 (1.4.4)
49
+ oauth2 (1.4.7)
50
50
  faraday (>= 0.8, < 2.0)
51
51
  jwt (>= 1.0, < 3.0)
52
52
  multi_json (~> 1.3)
53
53
  multi_xml (~> 0.5)
54
54
  rack (>= 1.2, < 3)
55
- pry (0.13.1)
55
+ pry (0.14.1)
56
56
  coderay (~> 1.1)
57
57
  method_source (~> 1.0)
58
- pry (0.13.1-java)
58
+ pry (0.14.1-java)
59
59
  coderay (~> 1.1)
60
60
  method_source (~> 1.0)
61
61
  spoon (~> 0.0)
@@ -67,14 +67,19 @@ GEM
67
67
  rake (13.0.3)
68
68
  rchardet (1.8.0)
69
69
  rdoc (6.3.0)
70
- rspec (2.99.0)
71
- rspec-core (~> 2.99.0)
72
- rspec-expectations (~> 2.99.0)
73
- rspec-mocks (~> 2.99.0)
74
- rspec-core (2.99.2)
75
- rspec-expectations (2.99.2)
76
- diff-lcs (>= 1.1.3, < 2.0)
77
- rspec-mocks (2.99.4)
70
+ rspec (3.10.0)
71
+ rspec-core (~> 3.10.0)
72
+ rspec-expectations (~> 3.10.0)
73
+ rspec-mocks (~> 3.10.0)
74
+ rspec-core (3.10.1)
75
+ rspec-support (~> 3.10.0)
76
+ rspec-expectations (3.10.1)
77
+ diff-lcs (>= 1.2.0, < 2.0)
78
+ rspec-support (~> 3.10.0)
79
+ rspec-mocks (3.10.2)
80
+ diff-lcs (>= 1.2.0, < 2.0)
81
+ rspec-support (~> 3.10.0)
82
+ rspec-support (3.10.2)
78
83
  semver2 (3.4.2)
79
84
  spoon (0.0.6)
80
85
  ffi
@@ -86,12 +91,12 @@ PLATFORMS
86
91
  ruby
87
92
 
88
93
  DEPENDENCIES
89
- bundler
90
- git
91
- jeweler (~> 2.3)
92
- launchy (~> 2.5)
93
- pry
94
- rspec (~> 2.7)
94
+ bundler (= 2.2.3)
95
+ git (= 1.8.1)
96
+ jeweler (= 2.3.5)
97
+ launchy (= 2.5.0)
98
+ pry (= 0.14.1)
99
+ rspec (= 3.10.0)
95
100
 
96
101
  BUNDLED WITH
97
102
  2.2.3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.4.0
data/bin/git-presenter CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  require "rubygems"
3
3
  require_relative "../lib/git_presenter"
4
4
 
5
- YAML::ENGINE.yamler = 'psych'
5
+ YAML::ENGINE.yamler = 'psych' if defined?(Psych::ENGINE)
6
6
 
7
7
  if ARGV[1] == "-c"
8
8
  interactive = false
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: git_presenter 1.3.0 ruby lib
5
+ # stub: git_presenter 1.4.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "git_presenter".freeze
9
- s.version = "1.3.0"
9
+ s.version = "1.4.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Colin Gemmell".freeze]
14
- s.date = "2021-01-11"
14
+ s.date = "2021-05-01"
15
15
  s.description = "Code presentation tool using git".freeze
16
16
  s.email = "pythonandchips@gmail.com".freeze
17
17
  s.executables = ["git-presenter".freeze]
@@ -57,19 +57,19 @@ Gem::Specification.new do |s|
57
57
  end
58
58
 
59
59
  if s.respond_to? :add_runtime_dependency then
60
- s.add_runtime_dependency(%q<git>.freeze, [">= 0"])
61
- s.add_runtime_dependency(%q<launchy>.freeze, ["~> 2.5"])
62
- s.add_development_dependency(%q<pry>.freeze, [">= 0"])
63
- s.add_development_dependency(%q<rspec>.freeze, ["~> 2.7"])
64
- s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
65
- s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3"])
60
+ s.add_runtime_dependency(%q<git>.freeze, ["= 1.8.1"])
61
+ s.add_runtime_dependency(%q<launchy>.freeze, ["= 2.5.0"])
62
+ s.add_development_dependency(%q<pry>.freeze, ["= 0.14.1"])
63
+ s.add_development_dependency(%q<rspec>.freeze, ["= 3.10.0"])
64
+ s.add_development_dependency(%q<bundler>.freeze, ["= 2.2.3"])
65
+ s.add_development_dependency(%q<jeweler>.freeze, ["= 2.3.5"])
66
66
  else
67
- s.add_dependency(%q<git>.freeze, [">= 0"])
68
- s.add_dependency(%q<launchy>.freeze, ["~> 2.5"])
69
- s.add_dependency(%q<pry>.freeze, [">= 0"])
70
- s.add_dependency(%q<rspec>.freeze, ["~> 2.7"])
71
- s.add_dependency(%q<bundler>.freeze, [">= 0"])
72
- s.add_dependency(%q<jeweler>.freeze, ["~> 2.3"])
67
+ s.add_dependency(%q<git>.freeze, ["= 1.8.1"])
68
+ s.add_dependency(%q<launchy>.freeze, ["= 2.5.0"])
69
+ s.add_dependency(%q<pry>.freeze, ["= 0.14.1"])
70
+ s.add_dependency(%q<rspec>.freeze, ["= 3.10.0"])
71
+ s.add_dependency(%q<bundler>.freeze, ["= 2.2.3"])
72
+ s.add_dependency(%q<jeweler>.freeze, ["= 2.3.5"])
73
73
  end
74
74
  end
75
75
 
@@ -7,7 +7,7 @@ describe "presentation should parse all commits for a repo" do
7
7
 
8
8
  it "should parse more than 10 commits" do
9
9
  @helper.initialise_presentation({:no_of_commits => 13}) do |commits, yaml|
10
- yaml["slides"].length.should eql 13
10
+ expect(yaml["slides"].length).to eql 13
11
11
  end
12
12
  end
13
13
  end
@@ -10,37 +10,37 @@ describe "initializing a presentation" do
10
10
  context ".presentation file" do
11
11
  it "should be written to root directory" do
12
12
  @helper.initialise_presentation do
13
- File.exists?(".presentation").should be_truthy
13
+ expect(File.exists?(".presentation")).to be_truthy
14
14
  end
15
15
  end
16
16
 
17
17
  it "should have a slides node" do
18
18
  @helper.initialise_presentation do |commits, yaml|
19
- yaml["slides"].should_not be_nil
19
+ expect(yaml["slides"]).not_to be_nil
20
20
  end
21
21
  end
22
22
 
23
23
  it 'should have a branch note' do
24
24
  @helper.initialise_presentation do |commits, yaml|
25
- yaml["branch"].should_not be_nil
25
+ expect(yaml["branch"]).not_to be_nil
26
26
  end
27
27
  end
28
28
 
29
29
  it "should contain a line for each commit to the repository" do
30
30
  @helper.initialise_presentation do |commits, yaml|
31
- yaml["slides"].length.should eql commits.length
31
+ expect(yaml["slides"].length).not_to eql commits.length
32
32
  end
33
33
  end
34
34
 
35
35
  it "first line should contain the first commit number" do
36
36
  @helper.initialise_presentation({:delay => true}) do |commits, yaml|
37
- yaml["slides"][0]["slide"]["commit"].should eql commits.first.sha
37
+ expect(yaml["slides"][0]["slide"]["commit"]).to eql commits.first.sha
38
38
  end
39
39
  end
40
40
 
41
41
  it "second line should contain the second commit number" do
42
42
  @helper.initialise_presentation({:delay => true}) do |commits, yaml|
43
- yaml["slides"][1]["slide"]["commit"].should eql commits[1].sha
43
+ expect(yaml["slides"][1]["slide"]["commit"]).to eql commits[1].sha
44
44
  end
45
45
  end
46
46
  end
@@ -11,7 +11,7 @@ describe "while giving presentation" do
11
11
  it "should move to the next commit" do
12
12
  @helper.start_presentation do |commits, presenter|
13
13
  presenter.execute("next")
14
- @helper.head_position.should eql commits[1].sha
14
+ expect(@helper.head_position).to eql commits[1].sha
15
15
  end
16
16
  end
17
17
 
@@ -19,7 +19,7 @@ describe "while giving presentation" do
19
19
  @helper.start_presentation do |commits, presenter|
20
20
  presenter.execute("next")
21
21
  presenter.execute("next")
22
- @helper.head_position.should eql commits[2].sha
22
+ expect(@helper.head_position).to eql commits[2].sha
23
23
  end
24
24
  end
25
25
  end
@@ -30,7 +30,7 @@ describe "while giving presentation" do
30
30
  presenter.execute("next")
31
31
  @helper.edit_file("inner commit")
32
32
  presenter.execute("next")
33
- @helper.head_position.should eql commits[2].sha
33
+ expect(@helper.head_position).to eql commits[2].sha
34
34
  end
35
35
  end
36
36
  end
@@ -42,7 +42,7 @@ describe "while giving presentation" do
42
42
  presenter.execute("next")
43
43
  presenter.execute("next")
44
44
  presenter.execute("next")
45
- @helper.head_position.should eql commits[2].sha
45
+ expect(@helper.head_position).to eql commits[2].sha
46
46
  end
47
47
  end
48
48
  end
@@ -53,7 +53,7 @@ describe "while giving presentation" do
53
53
  presenter.execute("next")
54
54
  presenter.execute("next")
55
55
  presenter.execute("back")
56
- @helper.head_position.should eql commits[1].sha
56
+ expect(@helper.head_position).to eql commits[1].sha
57
57
  end
58
58
  end
59
59
  end
@@ -67,7 +67,7 @@ describe "while giving presentation" do
67
67
  presenter.execute("back")
68
68
  presenter.execute("back")
69
69
  presenter.execute("back")
70
- @helper.head_position.should eql commits[0].sha
70
+ expect(@helper.head_position).to eql commits[0].sha
71
71
  end
72
72
  end
73
73
  end
@@ -78,7 +78,7 @@ describe "while giving presentation" do
78
78
  presenter.execute("next")
79
79
  presenter.execute("next")
80
80
  presenter.execute("start")
81
- @helper.head_position.should eql commits[0].sha
81
+ expect(@helper.head_position).to eql commits[0].sha
82
82
  end
83
83
  end
84
84
  end
@@ -87,7 +87,7 @@ describe "while giving presentation" do
87
87
  it "should move the last commit" do
88
88
  @helper.start_presentation do |commits, presenter|
89
89
  presenter.execute("end")
90
- @helper.head_position.should eql commits.last.sha
90
+ expect(@helper.head_position).to eql commits.last.sha
91
91
  end
92
92
  end
93
93
  end
@@ -96,7 +96,7 @@ describe "while giving presentation" do
96
96
  it "should checkout the specific commit" do
97
97
  @helper.start_presentation do |commits, presenter|
98
98
  presenter.execute("2")
99
- @helper.head_position.should eql commits[1].sha
99
+ expect(@helper.head_position).to eql commits[1].sha
100
100
  end
101
101
  end
102
102
  end
@@ -106,7 +106,7 @@ describe "while giving presentation" do
106
106
  @helper.start_presentation do |commits, presenter|
107
107
  expected_output = (["*#{commits.first.sha[0..9]}, #{commits.first.message}"] + commits[1..-1].map{|commit| "#{commit.sha[0..9]}, #{commit.message}"}).join("\n")
108
108
  presentation = presenter.execute("list")
109
- presentation.should eql expected_output
109
+ expect(presentation).to eql expected_output
110
110
  end
111
111
  end
112
112
  end
@@ -127,7 +127,7 @@ help/h: display this message
127
127
  exit: exit from the presentation
128
128
  EOH
129
129
  message = presenter.execute("help")
130
- message.should eql help_text
130
+ expect(message).to eql help_text
131
131
  end
132
132
  end
133
133
  end
@@ -138,7 +138,7 @@ EOH
138
138
  @helper.start_presentation([:run => "echo hello world"]) do |commits, presenter|
139
139
  presenter.execute("next")
140
140
  presenter.execute("next")
141
- presenter.execute("next").strip.should eql "hello world"
141
+ expect(presenter.execute("next").strip).to eql "hello world"
142
142
  end
143
143
  end
144
144
  end
@@ -148,7 +148,7 @@ EOH
148
148
  command_line_helper = CommandLineHelper.capture_output
149
149
  @helper.start_presentation([:run => "echo hello world",:on_slide => 2]) do |commits, presenter|
150
150
  presenter.execute("next")
151
- presenter.execute("next").should eql "#{commits[2].message}\nhello world\n"
151
+ expect(presenter.execute("next")).to eql "#{commits[2].message}\nhello world\n"
152
152
  end
153
153
  end
154
154
  end
@@ -158,7 +158,7 @@ EOH
158
158
  command_line_helper = CommandLineHelper.capture_output
159
159
  @helper.start_presentation do |commits, presenter|
160
160
  presenter.execute("!echo hello world")
161
- command_line_helper.command_output.strip.should end_with "hello world"
161
+ expect(command_line_helper.command_output.strip).to end_with "hello world"
162
162
  end
163
163
  end
164
164
  end
@@ -167,7 +167,7 @@ EOH
167
167
  it "should open the with launchy" do
168
168
  command_line_helper = CommandLineHelper.capture_output
169
169
  @helper.start_presentation([:launch => 'readme', :on_slide => 2]) do |commits, presenter|
170
- Launchy.should_receive(:open).with('readme').once
170
+ expect(Launchy).to receive(:open).with('readme').once
171
171
  presenter.execute("next")
172
172
  presenter.execute("next")
173
173
  end
@@ -179,8 +179,8 @@ EOH
179
179
  @helper.start_presentation do |commits, presenter|
180
180
  presenter.execute("next")
181
181
  presenter.execute("exit")
182
- @helper.current_branch.should_not be_nil
183
- @helper.current_branch.should eql "master"
182
+ expect(@helper.current_branch).not_to be_nil
183
+ expect(@helper.current_branch).to eql "master"
184
184
  end
185
185
  end
186
186
  end
@@ -189,7 +189,7 @@ EOH
189
189
  it "should set the current slide to commit" do
190
190
  @helper.start_presentation([], 1) do |commits, presenter|
191
191
  presenter.execute("list")
192
- presenter.current_slide.commit.should eql commits[1].sha
192
+ expect(presenter.current_slide.commit).to eql commits[1].sha
193
193
  end
194
194
  end
195
195
  end
@@ -13,32 +13,32 @@ describe "starting a presentation" do
13
13
  Dir.chdir(presentation_dir) do
14
14
  presenter = GitPresenter.new(".", false)
15
15
  presentation = presenter.execute('start')
16
- presentation.slides.length.should eql 4
16
+ expect(presentation.slides.length).to eql 4
17
17
  end
18
18
  end
19
19
 
20
20
  it "first commit should be first commit in file" do
21
21
  @helper.start_presentation do |commits, presenter|
22
- presenter.slides[0].commit.should eql commits[0].sha
22
+ expect(presenter.slides[0].commit).to eql commits[0].sha
23
23
  end
24
24
  end
25
25
 
26
26
  it "second commit should be second commit in file" do
27
27
  @helper.start_presentation do |commits, presenter|
28
- presenter.slides[1].commit.should eql commits[1].sha
28
+ expect(presenter.slides[1].commit).to eql commits[1].sha
29
29
  end
30
30
  end
31
31
 
32
32
  it "the last commit should be a command" do
33
33
  command = "echo hello world"
34
34
  @helper.start_presentation([:run => command]) do |commits, presenter|
35
- presenter.slides[3].run.should eql command
35
+ expect(presenter.slides[3].run).to eql command
36
36
  end
37
37
  end
38
38
 
39
39
  it "should have the presentation at first commit" do
40
40
  @helper.start_presentation do |commits, presenter|
41
- @helper.head_position.should eql commits.first.sha
41
+ expect(@helper.head_position).to eql commits.first.sha
42
42
  end
43
43
  end
44
44
  end
@@ -10,7 +10,7 @@ describe "update presentation with any new commits" do
10
10
  commits = @helper.initialise_presentation({:delay => true})
11
11
  new_commit = @helper.edit_file_and_commit("forth commit", "d")
12
12
  @helper.update_presentation do |yaml|
13
- yaml["slides"].length.should eql (commits.length + 1)
13
+ expect(yaml["slides"].length).to eql (commits.length + 1)
14
14
  end
15
15
  end
16
16
 
@@ -18,7 +18,7 @@ describe "update presentation with any new commits" do
18
18
  commits = @helper.initialise_presentation({:delay => true})
19
19
  new_commit = @helper.edit_file_and_commit("forth commit", "d")
20
20
  @helper.update_presentation do |yaml|
21
- yaml["slides"].last["slide"]["commit"].should eql new_commit.sha
21
+ expect(yaml["slides"].last["slide"]["commit"]).to eql new_commit.sha
22
22
  end
23
23
  end
24
24
 
@@ -27,7 +27,7 @@ describe "update presentation with any new commits" do
27
27
  removed_commit = @helper.remove_from_presentation_at(1)
28
28
  new_commit = @helper.edit_file_and_commit("forth commit", "d")
29
29
  @helper.update_presentation do |yaml|
30
- yaml["slides"].length.should eql (commits.length)
30
+ expect(yaml["slides"].length).to eql (commits.length)
31
31
  end
32
32
  end
33
33
 
@@ -36,7 +36,7 @@ describe "update presentation with any new commits" do
36
36
  removed_commit = @helper.remove_from_presentation_at(1)
37
37
  new_commit = @helper.edit_file_and_commit("forth commit", "d")
38
38
  @helper.update_presentation
39
- @command_line.command_output.should include "Your presentation has been updated"
39
+ expect(@command_line.command_output).to include "Your presentation has been updated"
40
40
  end
41
41
 
42
42
  end
@@ -22,16 +22,16 @@ describe GitPresenter::Presentation do
22
22
  it "should display the current position" do
23
23
  fake_shell.should_receive(:run).with("git rev-parse HEAD").and_return("0")
24
24
  presenter = GitPresenter::Presentation.new(presentation, fake_shell)
25
- presenter.status_line.should eql "1/3 >"
25
+ expect(presenter.status_line).to eql "1/3 >"
26
26
  end
27
27
  end
28
28
 
29
29
 
30
30
  context "when calculating the position" do
31
31
  it "should return the index of the current commit" do
32
- fake_shell.should_receive(:run).with("git rev-parse HEAD").and_return("0")
32
+ expect(fake_shell).to receive(:run).with("git rev-parse HEAD").and_return("0")
33
33
  presenter = GitPresenter::Presentation.new(presentation, fake_shell)
34
- presenter.position.should eql 0
34
+ expect(presenter.position).to eql 0
35
35
  end
36
36
  end
37
37
 
@@ -42,59 +42,59 @@ describe GitPresenter::Presentation do
42
42
  end
43
43
 
44
44
  context "with bash command" do
45
- it { given_command("!echo hello world").should eql :command }
45
+ it { expect(given_command("!echo hello world")).to eql :command }
46
46
  end
47
47
 
48
48
  context "with next" do
49
- it { given_command("next").should eql :next }
49
+ it { expect(given_command("next")).to eql :next }
50
50
  end
51
51
 
52
52
  context "with next" do
53
- it { given_command("n").should eql :next }
53
+ it { expect(given_command("n")).to eql :next }
54
54
  end
55
55
 
56
56
  context "with back" do
57
- it { given_command("back").should eql :previous }
57
+ it { expect(given_command("back")).to eql :previous }
58
58
  end
59
59
 
60
60
  context "with b" do
61
- it { given_command("b").should eql :previous }
61
+ it { expect(given_command("b")).to eql :previous }
62
62
  end
63
63
 
64
64
  context "with start" do
65
- it { given_command("start").should eql :start }
65
+ it { expect(given_command("start")).to eql :start }
66
66
  end
67
67
 
68
68
  context "with s" do
69
- it { given_command("s").should eql :start }
69
+ it { expect(given_command("s")).to eql :start }
70
70
  end
71
71
 
72
72
  context "with end" do
73
- it { given_command("end").should eql :end }
73
+ it { expect(given_command("end")).to eql :end }
74
74
  end
75
75
 
76
76
  context "with e" do
77
- it { given_command("e").should eql :end }
77
+ it { expect(given_command("e")).to eql :end }
78
78
  end
79
79
 
80
80
  context "with list" do
81
- it { given_command("list").should eql :list }
81
+ it { expect(given_command("list")).to eql :list }
82
82
  end
83
83
 
84
84
  context "with l" do
85
- it { given_command("l").should eql :list }
85
+ it { expect(given_command("l")).to eql :list }
86
86
  end
87
87
 
88
88
  context "with any number" do
89
- it { given_command("6").should eql :commit}
89
+ it { expect(given_command("6")).to eql :commit}
90
90
  end
91
91
 
92
92
  context "with h" do
93
- it { given_command("h").should eql :help}
93
+ it { expect(given_command("h")).to eql :help}
94
94
  end
95
95
 
96
96
  context "with help" do
97
- it { given_command("help").should eql :help}
97
+ it { expect(given_command("help")).to eql :help}
98
98
  end
99
99
 
100
100
  context "with exit" do
@@ -4,12 +4,12 @@ describe GitPresenter::Slide do
4
4
  context "when displaying as string" do
5
5
  it "should write out the commit id and the message" do
6
6
  slide = GitPresenter::Slide.new({"commit" => "012345678901234567890","message" => "message"})
7
- slide.to_s.should eql "0123456789, message"
7
+ expect(slide.to_s).to eql "0123456789, message"
8
8
  end
9
9
 
10
10
  it "should not blow up if no command exists" do
11
11
  slide = GitPresenter::Slide.new({"run" => "echo hello world"})
12
- slide.to_s.should eql "run: echo hello world"
12
+ expect(slide.to_s).to eql "run: echo hello world"
13
13
  end
14
14
  end
15
15
 
@@ -18,7 +18,7 @@ describe GitPresenter::Slide do
18
18
  it "should run that command" do
19
19
  command_line_helper = CommandLineHelper.capture_output
20
20
  slide = GitPresenter::Slide.new({"run" => "echo hello world"})
21
- slide.execute.strip.should eql "hello world"
21
+ expect(slide.execute.strip).to eql "hello world"
22
22
  end
23
23
  end
24
24
 
@@ -27,24 +27,24 @@ describe GitPresenter::Slide do
27
27
  command_line_helper = CommandLineHelper.capture_output
28
28
  slide = GitPresenter::Slide.new({"commit" => "number", "message" => "checkout", "run" => "echo hello world"})
29
29
  slide.stub(:checkout).and_return("checkout\n")
30
- slide.execute.should eql "checkout\nhello world\n"
30
+ expect(slide.execute).to eql "checkout\nhello world\n"
31
31
  end
32
32
  end
33
33
 
34
34
  context "when slide contains a launch command" do
35
35
  it "should launch the application for the file type" do
36
36
  command_line_helper = CommandLineHelper.capture_output
37
- Launchy.should_receive(:open).with("readme").once
37
+ expect(Launchy).to receive(:open).with("readme").once
38
38
  slide = GitPresenter::Slide.new({"launch" => "readme"})
39
39
  slide.execute
40
40
  end
41
41
 
42
42
  it "should not try and launch if no launch supplied" do
43
43
  command_line_helper = CommandLineHelper.capture_output
44
- Launchy.should_receive(:open).with("readme").never
44
+ expect(Launchy).to receive(:open).with("readme").never
45
45
  slide = GitPresenter::Slide.new({"commit" => "number", "message" => "checkout", "run" => "echo hello world"})
46
46
  slide.stub(:checkout).and_return("checkout\n")
47
- slide.execute.should eql "checkout\nhello world\n"
47
+ expect(slide.execute).to eql "checkout\nhello world\n"
48
48
  end
49
49
  end
50
50
 
@@ -53,7 +53,7 @@ describe GitPresenter::Slide do
53
53
  command_line_helper = CommandLineHelper.capture_output
54
54
  slide = GitPresenter::Slide.new({"commit" => "number", "message" => "checkout"})
55
55
  slide.stub(:checkout).and_return("checkout\n")
56
- slide.execute.should eql "checkout\n"
56
+ expect(slide.execute).to eql "checkout\n"
57
57
  end
58
58
  end
59
59
  end
metadata CHANGED
@@ -1,99 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Gemmell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 1.8.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 1.8.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: launchy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '2.5'
33
+ version: 2.5.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '2.5'
40
+ version: 2.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.14.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.14.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '2.7'
61
+ version: 3.10.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '2.7'
68
+ version: 3.10.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 2.2.3
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 2.2.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: jeweler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '2.3'
89
+ version: 2.3.5
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '2.3'
96
+ version: 2.3.5
97
97
  description: Code presentation tool using git
98
98
  email: pythonandchips@gmail.com
99
99
  executables: