Sha256: 3249a3cf9ad34db97071106f81d8e1ece20127f8f0b6777e1cf5cbe51197b8a5

Contents?: true

Size: 1.24 KB

Versions: 70

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

require 'active_support/core_ext/object'
require 'avm/eac_ruby_base1/launcher/gem/build'

RSpec.describe ::Avm::EacRubyBase1::Launcher::Gem::Build do
  describe '#output_file' do
    let(:gem_dir) do
      avm_eac_ruby_base1_source(target_path: temp_dir.join('ruby_gem_stub'))
        .path.to_path
    end

    it 'builds .gem file' do # rubocop:disable RSpec/ExampleLength
      expect(::File.directory?(gem_dir)).to eq true
      build = described_class.new(gem_dir)

      # Open/close
      assert_closed(build)
      build.build
      assert_open(build)
      build.close
      assert_closed(build)

      # Reopen/reclose
      build.build
      assert_open(build)
      build.close
      assert_closed(build)
    end

    private

    def assert_closed(build)
      expect(build.output_file.blank?).to eq true
      expect(build.builded?).to eq false
    end

    def assert_open(build) # rubocop:disable Metrics/AbcSize
      expect(build.output_file.present?).to eq true
      expect(build.builded?).to eq true
      expect(::File.exist?(build.output_file)).to eq true
      expect(::File.size(build.output_file)).to be_positive
      expect(::File.basename(build.output_file)).to eq('ruby_gem_stub-0.0.0.gem')
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
eac_tools-0.79.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.78.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.77.1 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.77.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.76.1 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.76.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.75.2 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.75.1 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.75.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.74.1 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.74.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.73.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.72.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.70.1 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.70.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.69.1 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.69.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.68.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.67.1 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb
eac_tools-0.67.0 sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/launcher/gem/build_spec.rb