Sha256: 7d0e102d4ce34dcf425c504764288b0e1dc628b024e87e464bb77e4611ca1169

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'ry', type: :rake do
  before do
    load_default_config
  end

  describe 'ry' do
    let(:task_name) { 'ry' }

    let(:default_version_warning) { /Task 'ry' without argument will use default Ruby version\./ }

    context 'without an argument' do
      it 'prints a warning' do
        expect do
          invoke_all
        end.to output(default_version_warning).to_stdout
      end

      it 'sets ruby version' do
        expect do
          invoke_all
        end.to output(output_file('ry_without_env')).to_stdout
      end
    end

    context 'with an argument' do
      it "doesn't print a warning" do
        expect do
          invoke_all('3.0.0')
        end.not_to output(default_version_warning).to_stdout
      end
    end

    it 'sets ruby version' do
      expect do
        invoke_all('3.0.0')
      end.to output(output_file('ry_with_env')).to_stdout
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mina-1.2.5 spec/tasks/ry_spec.rb