polisher 0.10.2 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/bin/binary_gem_resolver.rb +2 -2
  3. data/bin/bundler2yum.rb +51 -0
  4. data/bin/check_ruby_spec.rb +32 -0
  5. data/bin/gem_dependency_checker.rb +13 -242
  6. data/bin/gem_mapper.rb +27 -0
  7. data/bin/gems2update.rb +27 -0
  8. data/bin/git_gem_diff.rb +48 -0
  9. data/bin/git_gem_updater.rb +3 -3
  10. data/bin/missing_deps.rb +29 -0
  11. data/bin/polisher-config.rb +17 -0
  12. data/bin/ruby_rpm_spec_updater.rb +23 -2
  13. data/lib/polisher.rb +5 -12
  14. data/lib/polisher/adaptors/checker_loader.rb +78 -0
  15. data/lib/polisher/{upstream.rb → adaptors/upstream.rb} +1 -0
  16. data/lib/polisher/adaptors/version_checker.rb +57 -0
  17. data/lib/polisher/adaptors/version_checker/bodhi.rb +29 -0
  18. data/lib/polisher/adaptors/version_checker/errata.rb +29 -0
  19. data/lib/polisher/adaptors/version_checker/fedora.rb +29 -0
  20. data/lib/polisher/adaptors/version_checker/gem.rb +27 -0
  21. data/lib/polisher/adaptors/version_checker/git.rb +29 -0
  22. data/lib/polisher/adaptors/version_checker/koji.rb +29 -0
  23. data/lib/polisher/adaptors/version_checker/yum.rb +29 -0
  24. data/lib/polisher/cli/all.rb +22 -0
  25. data/lib/polisher/cli/bin/gem_dependency_checker.rb +85 -0
  26. data/lib/polisher/cli/bin/gem_mapper.rb +37 -0
  27. data/lib/polisher/cli/bin/gems2update.rb +86 -0
  28. data/lib/polisher/cli/bin/missing_deps.rb +35 -0
  29. data/lib/polisher/cli/conf.rb +18 -0
  30. data/lib/polisher/cli/default.rb +25 -0
  31. data/lib/polisher/cli/format.rb +130 -0
  32. data/lib/polisher/cli/sources.rb +106 -0
  33. data/lib/polisher/cli/specifier.rb +30 -0
  34. data/lib/polisher/cli/status.rb +50 -0
  35. data/lib/polisher/cli/targets.rb +88 -0
  36. data/lib/polisher/gem.rb +41 -338
  37. data/lib/polisher/gem/attributes.rb +20 -0
  38. data/lib/polisher/gem/dependencies.rb +63 -0
  39. data/lib/polisher/gem/diff.rb +39 -0
  40. data/lib/polisher/gem/files.rb +111 -0
  41. data/lib/polisher/gem/parser.rb +85 -0
  42. data/lib/polisher/gem/retriever.rb +137 -0
  43. data/lib/polisher/{gem_state.rb → gem/state.rb} +6 -6
  44. data/lib/polisher/gem/versions.rb +131 -0
  45. data/lib/polisher/gemfile.rb +20 -89
  46. data/lib/polisher/gemfile/attributes.rb +19 -0
  47. data/lib/polisher/gemfile/deps.rb +43 -0
  48. data/lib/polisher/gemfile/parser.rb +45 -0
  49. data/lib/polisher/git/pkg.rb +33 -238
  50. data/lib/polisher/git/pkg/attributes.rb +60 -0
  51. data/lib/polisher/git/pkg/builder.rb +47 -0
  52. data/lib/polisher/git/pkg/repo.rb +82 -0
  53. data/lib/polisher/git/pkg/updater.rb +53 -0
  54. data/lib/polisher/git/pkg/versions.rb +40 -0
  55. data/lib/polisher/git/project.rb +1 -1
  56. data/lib/polisher/git/repo.rb +79 -76
  57. data/lib/polisher/{vendor.rb → mixins/vendored_deps.rb} +4 -7
  58. data/lib/polisher/mixins/versioned_dependencies.rb +86 -0
  59. data/lib/polisher/record.rb +2 -0
  60. data/lib/polisher/rpm.rb +23 -0
  61. data/lib/polisher/rpm/patch.rb +10 -8
  62. data/lib/polisher/rpm/requirement.rb +33 -189
  63. data/lib/polisher/rpm/requirement/attributes.rb +43 -0
  64. data/lib/polisher/rpm/requirement/comparison.rb +97 -0
  65. data/lib/polisher/rpm/requirement/gem_reference.rb +46 -0
  66. data/lib/polisher/rpm/requirement/parser.rb +41 -0
  67. data/lib/polisher/rpm/spec.rb +97 -436
  68. data/lib/polisher/rpm/spec/check.rb +14 -0
  69. data/lib/polisher/rpm/spec/comparison.rb +64 -0
  70. data/lib/polisher/rpm/spec/files.rb +15 -0
  71. data/lib/polisher/rpm/spec/gem_files.rb +65 -0
  72. data/lib/polisher/rpm/spec/gem_reference.rb +59 -0
  73. data/lib/polisher/rpm/spec/gem_requirements.rb +73 -0
  74. data/lib/polisher/rpm/spec/parser.rb +106 -0
  75. data/lib/polisher/rpm/spec/requirements.rb +31 -0
  76. data/lib/polisher/rpm/spec/subpackages.rb +23 -0
  77. data/lib/polisher/rpm/spec/updater.rb +268 -0
  78. data/lib/polisher/specifier.rb +13 -0
  79. data/lib/polisher/targets.rb +36 -0
  80. data/lib/polisher/{apt.rb → targets/apt.rb} +1 -1
  81. data/lib/polisher/targets/bodhi.rb +43 -0
  82. data/lib/polisher/{bugzilla.rb → targets/bugzilla.rb} +1 -1
  83. data/lib/polisher/targets/errata.rb +55 -0
  84. data/lib/polisher/targets/errata/build.rb +24 -0
  85. data/lib/polisher/targets/fedora.rb +47 -0
  86. data/lib/polisher/targets/koji.rb +39 -0
  87. data/lib/polisher/targets/koji/builder.rb +38 -0
  88. data/lib/polisher/targets/koji/diff.rb +39 -0
  89. data/lib/polisher/targets/koji/rpc.rb +43 -0
  90. data/lib/polisher/targets/koji/versions.rb +67 -0
  91. data/lib/polisher/targets/rhn.rb +12 -0
  92. data/lib/polisher/targets/yum.rb +36 -0
  93. data/lib/polisher/{component.rb → util/component.rb} +3 -3
  94. data/lib/polisher/util/conf_helpers.rb +77 -0
  95. data/lib/polisher/util/config.rb +45 -0
  96. data/lib/polisher/util/core_ext.rb +59 -0
  97. data/lib/polisher/{error.rb → util/error.rb} +0 -0
  98. data/lib/polisher/{gem_cache.rb → util/gem_cache.rb} +1 -1
  99. data/lib/polisher/{git_cache.rb → util/git_cache.rb} +0 -0
  100. data/lib/polisher/{logger.rb → util/logger.rb} +2 -0
  101. data/lib/polisher/{tag_mapper.rb → util/tag_mapper.rb} +1 -1
  102. data/lib/polisher/version.rb +1 -1
  103. data/spec/{upstream_spec.rb → adaptors/upstream_spec.rb} +1 -1
  104. data/spec/{version_checker_spec.rb → adaptors/version_checker_spec.rb} +1 -6
  105. data/spec/data/activesupport-4.1.4.gem +0 -0
  106. data/spec/data/rubygem-activesupport-with-doc.spec +247 -0
  107. data/spec/data/rubygem-activesupport-without-requires.spec +232 -0
  108. data/spec/data/rubygem-activesupport.spec +0 -122
  109. data/spec/fixtures/gem_json.rb +49 -0
  110. data/spec/fixtures/gem_spec.rb +13 -0
  111. data/spec/fixtures/gemfile.rb +10 -0
  112. data/spec/fixtures/local_gem.rb +62 -0
  113. data/spec/fixtures/rpm_spec.rb +91 -0
  114. data/spec/gem/attributes_spec.rb +17 -0
  115. data/spec/gem/diff_spec.rb +80 -0
  116. data/spec/gem/files_spec.rb +171 -0
  117. data/spec/gem/parser_spec.rb +44 -0
  118. data/spec/gem/retriever_spec.rb +124 -0
  119. data/spec/gem/state_spec.rb +79 -0
  120. data/spec/gem/versions_spec.rb +148 -0
  121. data/spec/gem_spec.rb +5 -347
  122. data/spec/gemfile/deps_spec.rb +20 -0
  123. data/spec/gemfile/parser_spec.rb +26 -0
  124. data/spec/gemfile_spec.rb +0 -34
  125. data/spec/git/pkg/attributes_spec.rb +128 -0
  126. data/spec/git/pkg/builder_spec.rb +63 -0
  127. data/spec/git/pkg/repo_spec.rb +146 -0
  128. data/spec/git/pkg/updater_spec.rb +86 -0
  129. data/spec/git/pkg/versions_spec.rb +42 -0
  130. data/spec/git/pkg_spec.rb +21 -0
  131. data/spec/git/project_spec.rb +21 -0
  132. data/spec/git/repo_spec.rb +160 -0
  133. data/spec/{vendor_spec.rb → mixins/vendored_deps_spec.rb} +2 -4
  134. data/spec/mixins/versioned_dependencies_spec.rb +48 -0
  135. data/spec/rpm/patch_spec.rb +48 -0
  136. data/spec/rpm/requirement/attributes_spec.rb +34 -0
  137. data/spec/rpm/requirement/comparison_spec.rb +286 -0
  138. data/spec/rpm/requirement/gem_spec.rb +49 -0
  139. data/spec/rpm/requirement/parser_spec.rb +31 -0
  140. data/spec/rpm/requirement_spec.rb +8 -334
  141. data/spec/rpm/spec/check_spec.rb +25 -0
  142. data/spec/rpm/spec/comparison_spec.rb +55 -0
  143. data/spec/rpm/spec/files_spec.rb +17 -0
  144. data/spec/rpm/spec/gem_files_spec.rb +112 -0
  145. data/spec/rpm/spec/gem_reference_spec.rb +99 -0
  146. data/spec/rpm/spec/gem_requirement_spec.rb +38 -0
  147. data/spec/rpm/spec/parser_spec.rb +64 -0
  148. data/spec/rpm/spec/requirements_spec.rb +10 -0
  149. data/spec/rpm/spec/subpackages_spec.rb +38 -0
  150. data/spec/rpm/spec/updater_spec.rb +486 -0
  151. data/spec/rpm/spec_spec.rb +27 -174
  152. data/spec/spec_helper.rb +7 -107
  153. data/spec/support/coveralls.rb +10 -0
  154. data/spec/support/fixtures.rb +8 -0
  155. data/spec/support/paths.rb +20 -0
  156. data/spec/support/rspec.rb +20 -0
  157. data/spec/support/vcr.rb +11 -0
  158. data/spec/{bodhi_spec.rb → targets/bodhi_spec.rb} +3 -1
  159. data/spec/{errata_spec.rb → targets/errata_spec.rb} +2 -2
  160. data/spec/{fedora_spec.rb → targets/fedora_spec.rb} +3 -3
  161. data/spec/targets/koji/builder_spec.rb +48 -0
  162. data/spec/targets/koji/diff_spec.rb +36 -0
  163. data/spec/targets/koji/rpc_spec.rb +28 -0
  164. data/spec/{koji_spec.rb → targets/koji/versions_spec.rb} +1 -59
  165. data/spec/targets/koji_spec.rb +11 -0
  166. data/spec/{yum_spec.rb → targets/yum_spec.rb} +1 -1
  167. data/spec/{component_spec.rb → util/component_spec.rb} +1 -1
  168. data/spec/{core_spec.rb → util/core_ext_spec.rb} +2 -3
  169. metadata +278 -88
  170. data/lib/polisher/bodhi.rb +0 -23
  171. data/lib/polisher/config.rb +0 -32
  172. data/lib/polisher/core.rb +0 -101
  173. data/lib/polisher/errata.rb +0 -75
  174. data/lib/polisher/fedora.rb +0 -46
  175. data/lib/polisher/git.rb +0 -8
  176. data/lib/polisher/koji.rb +0 -159
  177. data/lib/polisher/rhn.rb +0 -15
  178. data/lib/polisher/version_checker.rb +0 -177
  179. data/lib/polisher/yum.rb +0 -37
  180. data/spec/git_spec.rb +0 -445
@@ -3,8 +3,6 @@
3
3
  # Licensed under the MIT license
4
4
  # Copyright (C) 2014 Red Hat, Inc.
5
5
 
6
- require 'spec_helper'
7
-
8
6
  require 'polisher/rpm/spec'
9
7
  require 'polisher/gem'
10
8
 
@@ -13,195 +11,50 @@ module Polisher::RPM
13
11
  describe "#initialize" do
14
12
  it "sets gem metadata" do
15
13
  spec = described_class.new :version => '1.0.0'
16
- spec.metadata.should == {:version => '1.0.0'}
14
+ spec.metadata.should == described_class.default_metadata.merge(:version => '1.0.0')
17
15
  end
18
16
  end
19
-
17
+
20
18
  describe "#method_missing" do
21
19
  it "proxies lookup to metadata" do
22
20
  spec = described_class.new :version => '1.0.0'
23
21
  spec.version.should == '1.0.0'
24
22
  end
25
- end
26
-
27
- describe "#has_check?" do
28
- context "package spec has %check section" do
29
- it "returns true" do
30
- spec = described_class.new :has_check => true
31
- spec.has_check?.should be_true
32
- end
33
- end
34
-
35
- context "package spec does not have a %check section" do
36
- it "returns false" do
23
+
24
+ context "metadata key not set" do
25
+ it "returns nil" do
37
26
  spec = described_class.new
38
- spec.has_check?.should be_false
27
+ spec.version.should be_nil
39
28
  end
40
29
  end
41
- end
42
-
43
-
44
- describe "#requirements_for_gem" do
45
- it "returns requirements for specified gem name" do
46
- spec = described_class.new :requires =>
47
- [Requirement.new(:name => 'rubygem(rake)')]
48
- spec.requirements_for_gem('rake').should == [spec.requires.first]
30
+
31
+ it "sets metadata" do
32
+ spec = described_class.new
33
+ spec.version = '1.0'
34
+ spec.version.should == '1.0'
35
+ spec.metadata[:version].should == '1.0'
49
36
  end
50
-
51
- context "spec has no requirement with specified name" do
52
- it "returns empty array" do
53
- spec = described_class.new
54
- spec.requirements_for_gem('rake').should be_empty
37
+
38
+ context "method not a metadata key" do
39
+ it "dispatches to super" do
40
+ lambda{
41
+ described_class.new.foo
42
+ }.should raise_error
55
43
  end
56
44
  end
57
45
  end
58
-
59
- describe "#parse" do
60
- before(:each) do
61
- @spec = Polisher::Test::RPM_SPEC
62
- end
63
-
64
- it "returns new rpmspec instance" do
65
- pspec = described_class.parse @spec[:contents]
66
- pspec.should be_an_instance_of(described_class)
67
- end
68
-
69
- it "parses contents from spec" do
70
- pspec = described_class.parse @spec[:contents]
71
- pspec.contents.should == @spec[:contents]
72
- end
73
-
74
- it "parses name from spec" do
75
- pspec = described_class.parse @spec[:contents]
76
- pspec.gem_name.should == @spec[:name]
77
- end
78
-
79
- it "parses version from spec" do
80
- pspec = described_class.parse @spec[:contents]
81
- pspec.version.should == @spec[:version]
82
- end
83
-
84
- it "parses release from spec" do
85
- pspec = described_class.parse @spec[:contents]
86
- pspec.release.should == @spec[:release]
87
- end
88
-
89
- it "parses requires from spec" do
90
- pspec = described_class.parse @spec[:contents]
91
- pspec.requires.should == @spec[:requires]
92
- end
93
-
94
- it "parses build requires from spec" do
95
- pspec = described_class.parse @spec[:contents]
96
- pspec.build_requires.should == @spec[:build_requires]
97
- end
98
-
99
- it "parses changelog from spec"
100
-
101
- it "parses unrpmized files from spec" do
102
- pspec = described_class.parse @spec[:contents]
103
- pspec.files.should == @spec[:files]
104
- end
105
-
106
- it "parses %check from spec" do
107
- pspec = described_class.parse @spec[:contents]
108
- pspec.has_check?.should be_true
109
-
110
- pspec = described_class.parse ""
111
- pspec.has_check?.should be_false
112
- end
113
- end
114
-
115
- describe "#update_to" do
116
- it "updates dependencies from gem" do
117
- spec = described_class.new :requires => [Requirement.parse('rubygem(rake)'),
118
- Requirement.parse('rubygem(activerecord)')],
119
- :build_requires => []
120
- gem = Polisher::Gem.new :deps => [::Gem::Dependency.new('rake'),
121
- ::Gem::Dependency.new('rails', '~> 10')],
122
- :dev_deps => [::Gem::Dependency.new('rspec', :development)]
123
-
124
- # stub out a few methods
125
- spec.should_receive(:excluded_deps).at_least(:once).and_return([])
126
- spec.should_receive(:excluded_dev_deps).at_least(:once).and_return([])
127
- spec.should_receive(:update_files_from)
128
46
 
129
- spec.update_to(gem)
130
- spec.requires.should == [Requirement.parse('rubygem(activerecord)'),
131
- Requirement.parse('rubygem(rake) >= 0'),
132
- Requirement.parse('rubygem(rails) => 10'),
133
- Requirement.parse('rubygem(rails) < 11')]
134
- spec.build_requires.should == [Requirement.parse('rubygem(rspec) >= 0', :br => true)]
135
- end
136
-
137
- it "adds new files from gem" do
138
- spec = described_class.new :files => {'pkg' => ['/foo']}
139
- gem = Polisher::Gem.new
140
- gem.should_receive(:file_paths).at_least(:once).
141
- and_return(['/foo', '/foo/bar', '/baz'])
142
- spec.update_to(gem)
143
- spec.new_files.should == ['%{gem_instdir}//baz']
144
- end
145
-
146
- it "updates metadata from gem" do
147
- spec = described_class.new
148
- gem = Polisher::Gem.new :version => '1.0.0'
149
- spec.should_receive(:update_files_from) # stub out files update
150
- spec.update_to(gem)
151
- spec.version.should == '1.0.0'
152
- spec.release.should == '1%{?dist}'
153
- end
154
-
155
- it "adds changelog entry"
156
- end
157
-
158
47
  describe "#to_string" do
159
- it "returns string representation of spec"
160
- end
161
-
162
- describe "#compare" do
163
- it "returns requirements in spec but not in gem" do
164
- req = Requirement.parse 'rubygem(rails) > 3.0.0'
165
- spec = described_class.new :requires => [req]
166
- gem = Polisher::Gem.new
167
-
168
- spec.compare(gem).should ==
169
- {:same => {}, :diff => {'rails' =>
170
- {:spec => '> 3.0.0', :upstream => nil}}}
171
- end
172
-
173
- it "returns requirements in gem but not in spec" do
174
- req = ::Gem::Dependency.new('rails', '> 3.0.0')
175
- spec = described_class.new
176
- gem = Polisher::Gem.new :deps => [req]
177
-
178
- spec.compare(gem).should ==
179
- {:same => {}, :diff => {'rails' =>
180
- {:spec => nil, :upstream => '> 3.0.0'}}}
181
- end
182
-
183
- it "returns shared requirements with different specifiers" do
184
- greq = ::Gem::Dependency.new('rails', '< 5.0.0')
185
- gem = Polisher::Gem.new :deps => [greq]
186
-
187
- sreq = Requirement.parse 'rubygem(rails) > 3.0.0'
188
- spec = described_class.new :requires => [sreq]
189
-
190
- spec.compare(gem).should ==
191
- {:same => {}, :diff => {'rails' =>
192
- {:spec => '> 3.0.0', :upstream => '< 5.0.0'}}}
48
+ it "returns string representation of spec" do
49
+ spec = described_class.new :contents => 'contents'
50
+ spec.to_string.should == "contents"
193
51
  end
194
-
195
- it "returns shared requirements" do
196
- greq = ::Gem::Dependency.new('rails', '< 3.0.0')
197
- gem = Polisher::Gem.new :deps => [greq]
198
-
199
- sreq = Requirement.parse 'rubygem(rails) < 3.0.0'
200
- spec = described_class.new :requires => [sreq]
201
-
202
- spec.compare(gem).should ==
203
- {:diff => {}, :same => {'rails' =>
204
- {:spec => '< 3.0.0', :upstream => '< 3.0.0'}}}
52
+ end
53
+
54
+ describe "#length" do
55
+ it "returns the length of spec contents" do
56
+ spec = described_class.new :contents => 'contents'
57
+ spec.length.should == 8
205
58
  end
206
59
  end
207
60
  end # describe Spec
@@ -3,113 +3,13 @@
3
3
  # Licensed under the MIT license
4
4
  # Copyright (C) 2013-2014 Red Hat, Inc.
5
5
 
6
- SPEC_DIR = File.expand_path File.dirname(__FILE__)
7
-
8
- begin
9
- require 'coveralls'
10
- Coveralls.wear!
11
- rescue LoadError
12
- end
13
-
14
- require 'polisher/rpm/spec'
15
- require 'polisher/gem_cache'
16
-
17
- RSpec.configure do |config|
18
- # Run specs in random order to surface order dependencies. If you find an
19
- # order dependency and want to debug it, you can fix the order by providing
20
- # the seed, which is printed after each run.
21
- # --seed 1234
22
- config.order = 'random'
23
-
24
- config.after do
25
- Polisher::GemCache.clear!
26
- end
27
- end
28
-
29
6
  module Polisher
30
7
  module Test
31
- GEM_SPEC = {
32
- :path => "#{SPEC_DIR}/data/mysql-2.9.1.gemspec",
33
- :name => 'mysql',
34
- :version => '2.9.1',
35
- :deps => [],
36
- :dev_deps => [::Gem::Dependency.new('rdoc', '~> 3.10', :development),
37
- ::Gem::Dependency.new('rake-compiler', '~> 0.8.1', :development),
38
- ::Gem::Dependency.new('hoe', '~> 3.5', :development)]
39
- }
40
-
41
- GEM_JSON = {
42
- :url => "https://rubygems.org/api/v1/gems/rails.json",
43
- :json => File.read("#{SPEC_DIR}/data/rails.json"),
44
- :name => 'rails',
45
- :version => '4.0.1',
46
- :deps => [::Gem::Dependency.new("actionmailer", '= 4.0.1'),
47
- ::Gem::Dependency.new("actionpack", '= 4.0.1'),
48
- ::Gem::Dependency.new("activerecord", '= 4.0.1'),
49
- ::Gem::Dependency.new("activesupport", '= 4.0.1'),
50
- ::Gem::Dependency.new("bundler", "< 2.0", ">= 1.3.0"),
51
- ::Gem::Dependency.new("railties", '= 4.0.1'),
52
- ::Gem::Dependency.new("sprockets-rails", '~> 2.0.0')],
53
- :dev_deps => []
54
- }
55
-
56
- LOCAL_GEM = {
57
- :json_url => "https://rubygems.org/api/v1/gems/rspec.json",
58
- :json => File.read("#{SPEC_DIR}/data/rspec.json"),
59
- :url => "https://rubygems.org/gems/rspec-2.12.0.gem",
60
- :contents => File.read("#{SPEC_DIR}/data/rspec-2.12.0.gem"),
61
- :name => 'rspec',
62
- :version => '2.14.1',
63
- :deps => [::Gem::Dependency.new('rspec-core', '~> 2.14.0'),
64
- ::Gem::Dependency.new('rspec-expectations', '~> 2.14.0'),
65
- ::Gem::Dependency.new('rspec-mocks', '~> 2.14.0')],
66
- :dev_deps => [],
67
- :files => ['License.txt', 'README.md', 'lib', 'lib/rspec', 'lib/rspec/version.rb', 'lib/rspec.rb']
68
- }
69
-
70
- GEMFILE = {
71
- :path => "#{SPEC_DIR}/data/Gemfile",
72
- :contents => File.read("#{SPEC_DIR}/data/Gemfile"),
73
- :deps => [::Gem::Dependency.new("rubygems", ::Gem::Requirement.new([">= 0"]), :runtime),
74
- ::Gem::Dependency.new("cinch", ::Gem::Requirement.new([">= 0"]), :runtime)]
75
- }
8
+ end
9
+ end
76
10
 
77
- RPM_SPEC = {
78
- :path => "#{SPEC_DIR}/data/rubygem-activesupport.spec",
79
- :contents => File.read("#{SPEC_DIR}/data/rubygem-activesupport.spec"),
80
- :name => "activesupport",
81
- :version => "4.0.0",
82
- :release => "1%{?dist}",
83
- :requires => [Polisher::RPM::Requirement.parse("ruby(rubygems)"),
84
- Polisher::RPM::Requirement.parse("ruby(release)"),
85
- Polisher::RPM::Requirement.parse("rubygem(bigdecimal)"),
86
- Polisher::RPM::Requirement.parse("rubygem(dalli)"),
87
- Polisher::RPM::Requirement.parse("rubygem(i18n) >= 0.6"),
88
- Polisher::RPM::Requirement.parse("rubygem(i18n) < 1.0"),
89
- Polisher::RPM::Requirement.parse("rubygem(minitest) >= 4.2"),
90
- Polisher::RPM::Requirement.parse("rubygem(minitest) < 5"),
91
- Polisher::RPM::Requirement.parse("rubygem(multi_json) >= 1.0"),
92
- Polisher::RPM::Requirement.parse("rubygem(multi_json) < 2"),
93
- Polisher::RPM::Requirement.parse("rubygem(rack)"),
94
- Polisher::RPM::Requirement.parse("rubygem(thread_safe)"),
95
- Polisher::RPM::Requirement.parse("rubygem(tzinfo) >= 0.3.37"),
96
- Polisher::RPM::Requirement.parse("rubygem(tzinfo) < 0.4.0")],
97
- :build_requires => [Polisher::RPM::Requirement.parse("rubygems-devel"),
98
- Polisher::RPM::Requirement.parse("rubygem(bigdecimal)"),
99
- Polisher::RPM::Requirement.parse("rubygem(builder)"),
100
- Polisher::RPM::Requirement.parse("rubygem(dalli)"),
101
- Polisher::RPM::Requirement.parse("rubygem(i18n) >= 0.6"),
102
- Polisher::RPM::Requirement.parse("rubygem(i18n) < 1.0"),
103
- Polisher::RPM::Requirement.parse("rubygem(minitest)"),
104
- Polisher::RPM::Requirement.parse("rubygem(mocha)"),
105
- Polisher::RPM::Requirement.parse("rubygem(multi_json) >= 1.0"),
106
- Polisher::RPM::Requirement.parse("rubygem(multi_json) < 2"),
107
- Polisher::RPM::Requirement.parse("rubygem(rack)"),
108
- Polisher::RPM::Requirement.parse("rubygem(thread_safe)"),
109
- Polisher::RPM::Requirement.parse("rubygem(tzinfo) >= 0.3.37"),
110
- Polisher::RPM::Requirement.parse("rubygem(tzinfo) < 0.4.0")],
111
- :changelog => "",
112
- :files => {"activesupport"=>["%{gem_instdir}", "CHANGELOG.md", "lib", "MIT-LICENSE", "README.rdoc", "%{gem_docdir}", "%{gem_cache}", "%{gem_spec}", "test"]}
113
- }
114
- end # module Test
115
- end # module Polisher
11
+ require 'support/paths'
12
+ require 'support/rspec'
13
+ require 'support/vcr'
14
+ require 'support/coveralls'
15
+ require 'support/fixtures'
@@ -0,0 +1,10 @@
1
+ # Polisher Spec Coveralls Integration
2
+ #
3
+ # Licensed under the MIT license
4
+ # Copyright (C) 2013-2014 Red Hat, Inc.
5
+
6
+ begin
7
+ require 'coveralls'
8
+ Coveralls.wear!
9
+ rescue LoadError
10
+ end
@@ -0,0 +1,8 @@
1
+ # Polisher Spec Fixtures
2
+ #
3
+ # Licensed under the MIT license
4
+ # Copyright (C) 2013-2014 Red Hat, Inc.
5
+
6
+ # TODO parameterize fixtures w/ defaults loaded from yaml
7
+
8
+ Dir.glob("#{spec_dir}/fixtures/*.rb") { |mod| require mod }
@@ -0,0 +1,20 @@
1
+ # Polisher Spec Path Helpers
2
+ #
3
+ # Licensed under the MIT license
4
+ # Copyright (C) 2013-2014 Red Hat, Inc.
5
+
6
+ def spec_support_dir
7
+ @spec_support_dir ||= File.expand_path(File.dirname(__FILE__))
8
+ end
9
+
10
+ def spec_dir
11
+ @spec_dir ||= File.expand_path(File.join(spec_support_dir, '..'))
12
+ end
13
+
14
+ def lib_dir
15
+ @lib_dir ||= File.expand_path(File.join(spec_dir, '..'))
16
+ end
17
+
18
+ def data_dir
19
+ @data_dir ||= File.expand_path(File.join(spec_dir, 'data'))
20
+ end
@@ -0,0 +1,20 @@
1
+ # Polisher Spec RSpec Integration
2
+ #
3
+ # Licensed under the MIT license
4
+ # Copyright (C) 2013-2014 Red Hat, Inc.
5
+
6
+ require 'polisher/util/gem_cache'
7
+
8
+ RSpec.configure do |config|
9
+ config.include Polisher::Test
10
+
11
+ # Run specs in random order to surface order dependencies. If you find an
12
+ # order dependency and want to debug it, you can fix the order by providing
13
+ # the seed, which is printed after each run.
14
+ # --seed 1234
15
+ config.order = 'random'
16
+
17
+ config.after do
18
+ Polisher::GemCache.clear!
19
+ end
20
+ end
@@ -0,0 +1,11 @@
1
+ # Polisher Spec VCR Integration
2
+ #
3
+ # Licensed under the MIT license
4
+ # Copyright (C) 2013-2014 Red Hat, Inc.
5
+
6
+ require 'vcr'
7
+ VCR.configure do |c|
8
+ c.cassette_library_dir = 'spec/vcr_cassettes'
9
+ c.hook_into :webmock
10
+ c.allow_http_connections_when_no_cassette = false
11
+ end
@@ -3,7 +3,9 @@
3
3
  # Licensed under the MIT license
4
4
  # Copyright (C) 2013-2014 Red Hat, Inc.
5
5
 
6
- require 'polisher/bodhi'
6
+ require 'polisher/targets/bodhi'
7
+
8
+ require 'pkgwat'
7
9
 
8
10
  module Polisher
9
11
  describe Bodhi do
@@ -3,7 +3,7 @@
3
3
  # Licensed under the MIT license
4
4
  # Copyright (C) 2013-2014 Red Hat, Inc.
5
5
 
6
- require 'polisher/errata'
6
+ require 'polisher/targets/errata'
7
7
 
8
8
  module Polisher
9
9
  describe Errata do
@@ -48,5 +48,5 @@ module Polisher
48
48
  described_class.versions_for('rails', &cb)
49
49
  end
50
50
  end
51
- end # describe Koji
51
+ end # describe Errata
52
52
  end # module Polisher