t1k 3.0.2 → 3.0.3

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
  SHA1:
3
- metadata.gz: c00fb15bd08b42750f3e4e1d68d2880ba7cee574
4
- data.tar.gz: 9607d5c8562fad145232fd20bb49b4552e737bf5
3
+ metadata.gz: f0764df51973aececa4ea017db567b069034eed9
4
+ data.tar.gz: dd02b07f3c521598ac9536324f419b5e1505632b
5
5
  SHA512:
6
- metadata.gz: de69ffb11d0ecfc37b6b7be7a7978bf932bd3e67c32fc56f9ea77b61dabca50fc3ea8c626cda77b31a0b227f35ec9f04ddb5572b74651c9c0edea0a58d4d3e9a
7
- data.tar.gz: ef59f6ef62749d076a5d1271f41f4307fd3b18466612a7b2efe56f2f196e360315d2748d17adcfc6a27559b21e660c0c38daabd47fafbba342234e9184913d7c
6
+ metadata.gz: 6be56803a0c99f500a513eae59564b70c0a0fea55bc03e09da0973b26cad69e449a245f0355a3959a1c9c8caefa8c7830cabc2e267df8c507127e3527917d410
7
+ data.tar.gz: 9d3d4fd0ea95e31e9a7d8938e37234bc06754bebd715e6cf213a90db433d8f8a54cbe40acbc57b4eb0e50b0c7236a3c793863f5ae3eaa19f22ee24dc1182df68
@@ -19,7 +19,7 @@ module T1k
19
19
 
20
20
  def self.commands_if_master(branch)
21
21
  [ "git checkout master",
22
- "git pull --rebase",
22
+ "git pull --rebase master",
23
23
  "git merge #{branch}",
24
24
  "git commit -v",
25
25
  "git push origin master"
@@ -30,7 +30,7 @@ module T1k
30
30
 
31
31
  def self.commands_if_branch(branch)
32
32
  [ "git checkout #{branch}",
33
- "git pull --rebase",
33
+ "git pull --rebase #{branch}",
34
34
  "git commit -v",
35
35
  "git push origin #{branch}"
36
36
  ].each do |cmd|
@@ -20,7 +20,7 @@ module T1k
20
20
  [ "git checkout master",
21
21
  "git pull --rebase origin master",
22
22
  "git checkout #{branch.strip}",
23
- "git rebase master #{branch.strip}"
23
+ "git rebase master"
24
24
  ].each do |cmd|
25
25
  system cmd
26
26
  end
@@ -28,7 +28,7 @@ module T1k
28
28
 
29
29
  def self.commands_if_branch(branch)
30
30
  [ "git checkout #{branch}",
31
- "git pull --rebase",
31
+ "git pull --rebase origin #{branch}",
32
32
  ].each do |cmd|
33
33
  system cmd
34
34
  end
data/lib/t1k/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module T1k
2
- VERSION = "3.0.2"
2
+ VERSION = "3.0.3"
3
3
  end
@@ -2,7 +2,14 @@ require 'spec_helper'
2
2
 
3
3
  describe T1k::Commands::PullRequest do
4
4
  subject { T1k::Commands::PullRequest }
5
+
5
6
  context '#run' do
7
+ before do
8
+ T1k.setup do |config|
9
+ config.repository.default_remote_branch = :master
10
+ config.repository.adapter = :bitbucket
11
+ end
12
+ end
6
13
  it 'have to sink' do
7
14
  expect(T1k::Commands::Sink).to receive(:run)
8
15
 
@@ -14,8 +21,7 @@ describe T1k::Commands::PullRequest do
14
21
  "git checkout master",
15
22
  "git pull --rebase origin master",
16
23
  "git checkout branch_name",
17
- "git rebase master branch_name",
18
- "git push origin branch_name"
24
+ "git rebase master"
19
25
  ].each do |cmd|
20
26
  allow_any_instance_of(Kernel).to receive(:system).with( cmd )
21
27
  end
@@ -3,19 +3,45 @@ require 'spec_helper'
3
3
  describe T1k::Commands::Ship do
4
4
  describe '#self.run' do
5
5
 
6
- it "should checkout to master" do
6
+ context "when default_remote_branch is :master" do
7
+ before do
8
+ T1k.setup do |config|
9
+ config.repository.default_remote_branch = :master
10
+ end
11
+ end
12
+
13
+ it "should checkout to master" do
14
+ [ "git checkout master",
15
+ "git pull --rebase master",
16
+ "git merge branch_name",
17
+ "git commit -v",
18
+ "git push origin master"
19
+ ].each do |cmd|
20
+ allow_any_instance_of(Kernel).to receive(:system).with( cmd )
21
+ end
7
22
 
8
- [
9
- "git checkout master",
10
- "git pull --rebase",
11
- "git merge branch_name",
12
- "git commit -v",
13
- "git push origin master"
14
- ].each do |cmd|
15
- allow_any_instance_of(Kernel).to receive(:system).with( cmd )
23
+ T1k::Commands::Ship.run
16
24
  end
25
+ end
17
26
 
18
- T1k::Commands::Ship.run
27
+ context "when default_remote_branch is :branch" do
28
+ before do
29
+ T1k.setup do |config|
30
+ config.repository.default_remote_branch = :branch
31
+ end
32
+ end
33
+
34
+ it "should checkout to branch_name" do
35
+ [ "git checkout branch_name",
36
+ "git pull --rebase branch_name",
37
+ "git commit -v",
38
+ "git push origin branch_name"
39
+ ].each do |cmd|
40
+ allow_any_instance_of(Kernel).to receive(:system).with( cmd )
41
+ end
42
+
43
+ T1k::Commands::Ship.run
44
+ end
19
45
  end
20
46
  end
21
47
  end
data/spec/t1k_spec.rb CHANGED
@@ -14,8 +14,6 @@ describe T1k do
14
14
  T1k.setup do |config|
15
15
  config.repository.adapter = :bitbucket
16
16
  end
17
-
18
- subject.setup_credentials
19
17
  end
20
18
 
21
19
  context 'on repository' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: t1k
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Maia
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-09-14 00:00:00.000000000 Z
13
+ date: 2016-09-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler