Sha256: 61496bdde64a80856973760076b6c70cb374b84db30d492276b71365536dc5eb

Contents?: true

Size: 862 Bytes

Versions: 21

Compression:

Stored size: 862 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

module Synvert::Core
  describe Rewriter::RubyVersion do
    before do
      allow(File).to receive(:exist?).with('./.ruby-version').and_return(true)
      allow(File).to receive(:read).with('./.ruby-version').and_return('3.0.0')
    end

    it 'returns true if ruby version is greater than 1.9' do
      ruby_version = Rewriter::RubyVersion.new('1.9')
      expect(ruby_version).to be_match
    end

    it 'returns false if ruby version is less than 19.0' do
      ruby_version = Rewriter::RubyVersion.new('19.0')
      expect(ruby_version).not_to be_match
    end

    it 'returns true if strict Configuration is false' do
      Configuration.strict = false
      ruby_version = Rewriter::RubyVersion.new('19.0')
      expect(ruby_version).to be_match
      Configuration.strict = true
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
synvert-core-2.1.0 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-2.0.3 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-2.0.2 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-2.0.1 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-2.0.0 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.35.4 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.35.3 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.35.2 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.35.1 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.35.0 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.34.0 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.33.3 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.33.2 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.33.1 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.33.0 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.32.1 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.32.0 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.31.1 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.31.0 spec/synvert/core/rewriter/ruby_version_spec.rb
synvert-core-1.30.3 spec/synvert/core/rewriter/ruby_version_spec.rb