Sha256: 68cede555b0b19069dbf34915e694e561f45ac8386c9655500c5bd5eee33a112
Contents?: true
Size: 1.56 KB
Versions: 4
Compression:
Stored size: 1.56 KB
Contents
require 'spec_helper' describe 'Gemspec' do before do build_appraisal_file build_rakefile end it 'supports gemspec syntax with default options' do build_gemspec write_file 'Gemfile', <<-Gemfile gem 'appraisal', :path => #{PROJECT_ROOT.inspect} gemspec Gemfile run 'bundle install --local' run 'appraisal install' output = run 'appraisal rake version' expect(output).to include 'Loaded 1.1.0' end it 'supports gemspec syntax with path option' do build_gemspec 'specdir' write_file 'Gemfile', <<-Gemfile gem 'appraisal', :path => #{PROJECT_ROOT.inspect} gemspec :path => './specdir' Gemfile run 'bundle install --local' run 'appraisal install' output = run 'appraisal rake version' expect(output).to include 'Loaded 1.1.0' end def build_appraisal_file super <<-Appraisals appraise 'stock' do gem 'rake' end Appraisals end def build_rakefile write_file 'Rakefile', <<-rakefile require 'rubygems' require 'bundler/setup' require 'appraisal' task :version do require 'dummy' puts "Loaded \#{$dummy_version}" end rakefile end def build_gemspec(path = '.') Dir.mkdir("tmp/stage/#{path}") rescue nil write_file File.join(path, 'gemspec_project.gemspec'), <<-gemspec Gem::Specification.new do |s| s.name = 'gemspec_project' s.version = '0.1' s.summary = 'Awesome Gem!' s.add_development_dependency('dummy', '1.1.0') end gemspec end end
Version data entries
4 entries across 4 versions & 1 rubygems