hitch 1.0.3 → 1.0.4

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: 721084c4633f44e81525934e2735712a2fceec8c
4
- data.tar.gz: 051501fead1542702313d084357f11e0772713c4
3
+ metadata.gz: e31466745b18c78b3065e2ce0fb9ef2ac902f1fe
4
+ data.tar.gz: 161bd434fdcd957688805804e6a8d2b64498e96e
5
5
  SHA512:
6
- metadata.gz: 551fdf140bea3acd13681fcb2821932bebfe1b784b9b869b4c6adf4fc4b1984a2d7c0d02795a3e2ae83102dc7f817a385846a13dca69de1db2df1f3c1242b117
7
- data.tar.gz: cde32aaf43b1471c7692d9e3a88f1852e4e092da01044480f8bdc9c6425fb49974baf5ab6e054091115d5adf9360fe35bbb2de4f967e94088ce59dbf0dd788a2
6
+ metadata.gz: b1fbfe1d1ec0f90441f444ae85f66d7fe2e595841258dcdec552ddb7c45373213df446020996a95f5ac7f533718acf349b07933a11c8f7f433d59cc1888f84e5
7
+ data.tar.gz: 348ad63679b1173ff0a0418b091d666deca5efe9fdf3019ed64e4f43c5c7c9efe70077a0348233691560e30af386cdabba3a2eeaceebb9bb456aae68dd155b61
@@ -4,8 +4,9 @@ Gem::Specification.new do |s|
4
4
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
5
5
  s.rubygems_version = '1.3.5'
6
6
 
7
+ s.license = "MIT"
7
8
  s.name = %q{hitch}
8
- s.version = '1.0.3'
9
+ s.version = '1.0.4'
9
10
  s.date = Time.now.strftime('%F')
10
11
 
11
12
  s.description = %q{Git author attribution helper for pair programmers.}
@@ -6,7 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib hitch ui]))
6
6
 
7
7
  module Hitch
8
8
 
9
- VERSION = '1.0.3'
9
+ VERSION = '1.0.4'
10
10
 
11
11
  def self.print_info
12
12
  if Hitch.pairing? && STDOUT.tty?
@@ -6,7 +6,7 @@ module Hitch
6
6
  def self.prompt_for_group_email
7
7
  Hitch.group_email = highline.ask("What is the group email? e.g. dev@hashrocket.com will become dev+therubymug+leshill@hashrocket.com") do |q|
8
8
  q.case = :down
9
- q.validate = /\A[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+\z/
9
+ q.validate = /\A[a-zA-Z0-9_\.\-\+]+@[a-zA-Z1-9\-]+\.[a-zA-Z0-9\-\.]+\z/
10
10
  end.to_s
11
11
  end
12
12
 
@@ -4,20 +4,40 @@ describe Hitch::UI do
4
4
 
5
5
  describe '.prompt_for_group_email' do
6
6
 
7
+ let(:question_message) { "What is the group email? e.g. dev@hashrocket.com will become dev+therubymug+leshill@hashrocket.com" }
8
+
7
9
  it 'prompts for group email' do
8
- Hitch::UI.highline.should_receive(:ask).with("What is the group email? e.g. dev@hashrocket.com will become dev+therubymug+leshill@hashrocket.com")
10
+ Hitch::UI.highline.should_receive(:ask).with(question_message)
9
11
  Hitch::UI.prompt_for_group_email
10
12
  end
11
13
 
12
14
  it 'returns the given group email' do
13
- Hitch::UI.highline.stub(:ask).with("What is the group email? e.g. dev@hashrocket.com will become dev+therubymug+leshill@hashrocket.com").and_return('dev@hashrocket.com')
15
+ Hitch::UI.highline.stub(:ask).with(question_message).and_return('dev@hashrocket.com')
14
16
  Hitch::UI.prompt_for_group_email.should == 'dev@hashrocket.com'
15
17
  end
16
18
 
17
- it 'sets Hitch.group_email' do
18
- Hitch.should_receive('group_email=').with('dev@hashrocket.com')
19
- Hitch::UI.highline.stub(:ask).with("What is the group email? e.g. dev@hashrocket.com will become dev+therubymug+leshill@hashrocket.com").and_return('dev@hashrocket.com')
20
- Hitch::UI.prompt_for_group_email
19
+ context 'when group email contains a `+` in it' do
20
+ let(:group_email) { 'dev+hitch@hashrocket.com' }
21
+ it 'sets Hitch.group_email' do
22
+ question = double({:case= => nil, :validate= => nil})
23
+ question.should_receive(:case=).with(:down)
24
+ question.should_receive(:validate=).with(/\A[a-zA-Z0-9_\.\-\+]+@[a-zA-Z1-9\-]+\.[a-zA-Z0-9\-\.]+\z/)
25
+ Hitch.should_receive('group_email=').with(group_email)
26
+ Hitch::UI.highline.stub(:ask).with(question_message).and_yield(question).and_return(group_email)
27
+ Hitch::UI.prompt_for_group_email
28
+ end
29
+ end
30
+
31
+ context 'when group email does not contain a `+` in it' do
32
+ let(:group_email) { 'dev@hashrocket.com' }
33
+ it 'sets Hitch.group_email' do
34
+ question = double({:case= => nil, :validate= => nil})
35
+ question.should_receive(:case=).with(:down)
36
+ question.should_receive(:validate=).with(/\A[a-zA-Z0-9_\.\-\+]+@[a-zA-Z1-9\-]+\.[a-zA-Z0-9\-\.]+\z/)
37
+ Hitch.should_receive('group_email=').with(group_email)
38
+ Hitch::UI.highline.stub(:ask).with(question_message).and_yield(question).and_return(group_email)
39
+ Hitch::UI.prompt_for_group_email
40
+ end
21
41
  end
22
42
 
23
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rogelio J. Samour
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -65,7 +65,8 @@ files:
65
65
  - spec/hitch_spec.rb
66
66
  - spec/spec_helper.rb
67
67
  homepage: http://github.com/therubymug/hitch
68
- licenses: []
68
+ licenses:
69
+ - MIT
69
70
  metadata: {}
70
71
  post_install_message:
71
72
  rdoc_options: