issuesrc 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,81 @@
1
+ require_relative '../lib/issuesrc'
2
+
3
+ describe Issuesrc do
4
+ before :each do
5
+ @obj = Class.new do
6
+ include Issuesrc
7
+ end.new
8
+ @obj.send(:set_config, {
9
+ :arg => 'fake arg'
10
+ }, {
11
+ 'config' => ['fake', 'config']
12
+ })
13
+ end
14
+
15
+ describe '#load_sourcer' do
16
+ it 'loads the sourcer component' do
17
+ allow(@obj).to receive(:load_component)
18
+ .and_return(['fake path', 'fake cls'])
19
+ allow(@obj).to receive(:do_require)
20
+ allow(@obj).to receive(:make_sourcer).and_return('fake sourcer')
21
+
22
+ expect(@obj).to receive(:load_component).with(
23
+ ['sourcer', 'sourcer'],
24
+ :sourcer,
25
+ Issuesrc::DEFAULT_SOURCER,
26
+ Issuesrc::SOURCERS)
27
+ expect(@obj).to receive(:do_require).with('fake path')
28
+ expect(@obj).to receive(:make_sourcer).with('fake cls')
29
+
30
+ sourcer = @obj.send(:load_sourcer)
31
+
32
+ expect(sourcer).to be == 'fake sourcer'
33
+ end
34
+ end
35
+
36
+ describe '#load_issuer' do
37
+ it 'loads the issuer component' do
38
+ allow(@obj).to receive(:load_component)
39
+ .and_return(['fake path', 'fake cls'])
40
+ allow(@obj).to receive(:do_require)
41
+ allow(@obj).to receive(:make_issuer).and_return('fake issuer')
42
+
43
+ @obj.send(:set_config, 'fake args', 'fake config')
44
+
45
+ expect(@obj).to receive(:load_component).with(
46
+ ['issuer', 'issuer'],
47
+ :issuer,
48
+ Issuesrc::DEFAULT_ISSUER,
49
+ Issuesrc::ISSUERS)
50
+ expect(@obj).to receive(:do_require).with('fake path')
51
+ expect(@obj).to receive(:make_issuer).with('fake cls', 'fake event loop')
52
+
53
+ issuer = @obj.send(:load_issuer, 'fake event loop')
54
+
55
+ expect(issuer).to be == 'fake issuer'
56
+ end
57
+ end
58
+
59
+ describe '#load_component' do
60
+ it 'loads a required component for issuesrc' do
61
+ component = @obj.send(:load_component,
62
+ ['config'], :arg, 'def', {'fake arg' => 'foo'})
63
+ expect(component).to be == 'foo'
64
+ end
65
+
66
+ it 'loads the default component when no option is given' do
67
+ component = @obj.send(:load_component,
68
+ ['fake'], :fake, 'def', {'def' => 'bar'})
69
+ expect(component).to be == 'bar'
70
+ end
71
+
72
+ it 'fails when loading an unknown component' do
73
+ allow(@obj).to receive(:exec_fail).and_raise('failed')
74
+
75
+ expect { @obj.send(:load_component, ['fake'], :fake, 'def', {}) }
76
+ .to raise_error('failed')
77
+ end
78
+ end
79
+
80
+ # TODO(#27): Complete testing.
81
+ end
File without changes
File without changes
File without changes
metadata ADDED
@@ -0,0 +1,155 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: issuesrc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Toni Cárdenas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: yard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '0.8'
69
+ - !ruby/object:Gem::Dependency
70
+ name: redcarpet
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Synchronize in-source commented tasks with your issue tracker.
84
+ email:
85
+ - toni@tcardenas.me
86
+ executables:
87
+ - issuesrc
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - .gitignore
92
+ - Gemfile
93
+ - LICENSE.txt
94
+ - README.md
95
+ - Rakefile
96
+ - bin/issuesrc
97
+ - example.toml
98
+ - issuesrc.gemspec
99
+ - lib/issuers/github_issuer.rb
100
+ - lib/issuesrc.rb
101
+ - lib/issuesrc/config.rb
102
+ - lib/issuesrc/event_loop.rb
103
+ - lib/issuesrc/file.rb
104
+ - lib/issuesrc/tag.rb
105
+ - lib/issuesrc/tag_extractor.rb
106
+ - lib/issuesrc/version.rb
107
+ - lib/sourcers/git_sourcer.rb
108
+ - lib/sourcers/github_sourcer.rb
109
+ - lib/tag_finders/blunt_tag_finder.rb
110
+ - spec/issuers/github_issuer_spec.rb
111
+ - spec/issuesrc/config_spec.rb
112
+ - spec/issuesrc/event_loop_spec.rb
113
+ - spec/issuesrc/file_spec.rb
114
+ - spec/issuesrc/tag_extractor_spec.rb
115
+ - spec/issuesrc/tag_spec.rb
116
+ - spec/issuesrc_spec.rb
117
+ - spec/sourcers/git_sourcer_spec.rb
118
+ - spec/sourcers/github_sourcer_spec.rb
119
+ - spec/tag_finders/blunt_tag_finder_spec.rb
120
+ homepage: https://github.com/tcard/issuesrc
121
+ licenses:
122
+ - GPLv2
123
+ metadata: {}
124
+ post_install_message:
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ~>
131
+ - !ruby/object:Gem::Version
132
+ version: 1.9.3
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ! '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubyforge_project:
140
+ rubygems_version: 2.4.3
141
+ signing_key:
142
+ specification_version: 4
143
+ summary: Synchronize in-source commented tasks with your issue tracker.
144
+ test_files:
145
+ - spec/issuers/github_issuer_spec.rb
146
+ - spec/issuesrc/config_spec.rb
147
+ - spec/issuesrc/event_loop_spec.rb
148
+ - spec/issuesrc/file_spec.rb
149
+ - spec/issuesrc/tag_extractor_spec.rb
150
+ - spec/issuesrc/tag_spec.rb
151
+ - spec/issuesrc_spec.rb
152
+ - spec/sourcers/git_sourcer_spec.rb
153
+ - spec/sourcers/github_sourcer_spec.rb
154
+ - spec/tag_finders/blunt_tag_finder_spec.rb
155
+ has_rdoc: