Sha256: 92621dcac74fa01b466a1f449d14dd8d9bfa6ac4df5d2893aebb7e352792fe8c
Contents?: true
Size: 1.56 KB
Versions: 56
Compression:
Stored size: 1.56 KB
Contents
# encoding: utf-8 require 'spec_helper' require 'fedux_org_stdlib/version_management/rubygem_version_file_parser' RSpec.describe FeduxOrgStdlib::VersionManagement::RubygemVersionFileParser do let(:parser) { FeduxOrgStdlib::VersionManagement::RubygemVersionFileParser.new } context '#parse' do it 'extracts version number' do write_file( 'version.rb', <<-EOS.strip_heredoc #main MyLibrary module MyLibrary VERSION = '0.0.0' end EOS ) parser.parse(absolute_path('version.rb')) expect(parser.version).to eq('0.0.0') end it 'extracts modules' do write_file( 'version.rb', <<-EOS.strip_heredoc #main MyLibrary module MyLibrary VERSION = '0.0.0' end EOS ) parser.parse(absolute_path('version.rb')) expect(parser.modules).to eq(['MyLibrary']) end it 'extracts nested modules as well' do write_file( 'version.rb', <<-EOS.strip_heredoc #main MyLibrary module MyLibrary module MyClass VERSION = '0.0.0' end end EOS ) parser.parse(absolute_path('version.rb')) expect(parser.modules).to eq(%w(MyLibrary MyClass)) end it 'fails if version cannot be extracted' do write_file( 'version.rb', <<-EOS.strip_heredoc #main MyLibrary EOS ) expect do parser.parse(absolute_path('version.rb')) end.to raise_error VersionManagement::Exceptions::VersionFileInvalid end end end
Version data entries
56 entries across 56 versions & 1 rubygems