Sha256: 6dc9f1a7102b8754739dd46f0d049adce392810e96f1bbda846e12ab8926782f

Contents?: true

Size: 1.63 KB

Versions: 45

Compression:

Stored size: 1.63 KB

Contents

Given /^a gem named '(.*)'$/ do |gem_name|
  generate_gem_task gem_name
end

Then /^ruby gem for '(.*)' version '(.*)' do exist in '(.*)'$/ do |name, version, folder|
  File.exist?(gem_file(folder, name, version)).should be_true
end

Then /^binary gem for '(.*)' version '(.*)' do exist in '(.*)'$/ do |name, version, folder|
  File.exist?(gem_file_platform(folder, name, version)).should be_true
end

Then /^a gem for '(.*)' version '(.*)' platform '(.*)' do exist in '(.*)'$/ do |name, version, platform, folder|
  File.exist?(gem_file_platform(folder, name, version, platform)).should be_true

  # unpack the Gem and check what's inside!
  `gem unpack #{gem_file_platform(folder, name, version, platform)} --target tmp`
  unpacked_gem_dir = unpacked_gem_dir_platform('tmp', name, version, platform)
  File.exist?(unpacked_gem_dir).should be_true

  files = Dir.glob("#{unpacked_gem_dir}/lib/*.#{binary_extension(platform)}")
  files << Dir.glob("#{unpacked_gem_dir}/lib/*/*.#{binary_extension(platform)}")

  files.flatten.uniq.should_not be_empty
end

Then /^gem for platform '(.*)' get generated$/ do |platform|
  step "a gem for 'gem_abc' version '0.1.0' platform '#{platform}' do exist in 'pkg'"
end

def gem_file(folder, name, version)
  "#{folder}/#{name}-#{version}.gem"
end

def gem_file_platform(folder, name, version, platform = nil)
  file = "#{folder}/#{name}-#{version}"
  file << "-" << (platform || Gem::Platform.new(RUBY_PLATFORM).to_s)
  file << ".gem"
  file
end

def unpacked_gem_dir_platform(folder, name, version, platform = nil)
  file = "#{folder}/#{name}-#{version}"
  file << "-" << (platform || Gem::Platform.new(RUBY_PLATFORM).to_s)
  file
end

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
rake-compiler-1.2.9 features/step_definitions/gem.rb
rake-compiler-1.2.8 features/step_definitions/gem.rb
rake-compiler-1.2.7 features/step_definitions/gem.rb
rake-compiler-1.2.6 features/step_definitions/gem.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rake-compiler-1.2.5/features/step_definitions/gem.rb
rake-compiler-1.2.5 features/step_definitions/gem.rb
rake-compiler-1.2.4 features/step_definitions/gem.rb
rake-compiler-1.2.3 features/step_definitions/gem.rb
rake-compiler-1.2.2 features/step_definitions/gem.rb
rake-compiler-1.2.1 features/step_definitions/gem.rb
rake-compiler-1.2.0 features/step_definitions/gem.rb
rake-compiler-1.1.9 features/step_definitions/gem.rb
rake-compiler-1.1.8 features/step_definitions/gem.rb
rake-compiler-1.1.7 features/step_definitions/gem.rb
rake-compiler-1.1.6 features/step_definitions/gem.rb
rake-compiler-1.1.5 features/step_definitions/gem.rb
rake-compiler-1.1.4 features/step_definitions/gem.rb
rake-compiler-1.1.3 features/step_definitions/gem.rb
rake-compiler-1.1.2 features/step_definitions/gem.rb
rake-compiler-1.1.1 features/step_definitions/gem.rb