diff options
Diffstat (limited to 'spec/support/builders.rb')
-rw-r--r-- | spec/support/builders.rb | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/support/builders.rb b/spec/support/builders.rb index e5072fa5..9459b299 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -8,6 +8,10 @@ module Spec Gem::Version.new(version) end + def pl(platform) + Gem::Platform.new(pl) + end + def build_repo1 build_repo gem_repo1 do build_gem "rack", %w(0.9.1 1.0.0) do |s| @@ -239,8 +243,9 @@ module Spec def build_spec(name, version, platform = nil, &block) Array(version).map do |v| Gem::Specification.new do |s| - s.name = name - s.version = Gem::Version.new(v) + s.name = name + s.version = Gem::Version.new(v) + s.platform = platform DepBuilder.run(s, &block) if block_given? end end @@ -308,6 +313,19 @@ module Spec end end + def platforms(platforms) + platforms.split(/\s+/).each do |platform| + platform = 'x86-mswin32' if platform == 'mswin32' + platform = Gem::Platform.new(platform) + if String === platform + class << platform + alias =~ == + end + end + yield Gem::Platform.new(platform) + end + end + def versions(versions) versions.split(/\s+/).each { |version| yield v(version) } end |