Skip to content

Commit

Permalink
Merge 7535db8 into 3eba897
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzedge committed May 12, 2023
2 parents 3eba897 + 7535db8 commit 260c742
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/integration/rambling/trie_spec.rb
Expand Up @@ -6,6 +6,26 @@
describe Rambling::Trie do
let(:assets_path) { File.join ::SPEC_ROOT, 'assets' }

describe '::VERSION' do
let(:root_path) { File.join ::SPEC_ROOT, '..' }
let(:readme_path) { File.join root_path, 'README.md' }
let(:readme) { File.read readme_path }
let(:changelog_path) { File.join root_path, 'CHANGELOG.md' }
let(:changelog) { File.read changelog_path }

it 'matches with the version in the README badge' do
match = %r{\?version=(?<version>.*)$}.match readme
expect(match['version']).to eq Rambling::Trie::VERSION
end

it 'is the version before the latest one in the CHANGELOG' do
match = %r{(?<version>\d+\.\d+\.\d+)}.match changelog.split("\n")[0]
changelog_version = Gem::Version.new match['version']
lib_version = Gem::Version.new Rambling::Trie::VERSION
expect(changelog_version).to be_between(lib_version, lib_version.bump).exclusive
end
end

context 'when providing words directly' do
it_behaves_like 'a compressible trie' do
let(:trie) { described_class.create }
Expand Down

0 comments on commit 260c742

Please sign in to comment.