Skip to content

Commit

Permalink
Test generated project against current working copy of Sequent gem
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrozendaal committed Jan 3, 2025
1 parent f8029c8 commit 39e95cb
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions spec/lib/sequent/generator/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,21 @@
expect(File.read('blog-with_special-symbols/Rakefile')).to include("require './blog_with_special_symbols'")
end

# Ignore for now until we find a way to correctly test the template project
# against the locally checked out sequent code.
xit 'has working example with specs' do
it 'has working example with specs' do
execute

contents = File.read('blog-with_special-symbols/Gemfile')
File.write(
'blog-with_special-symbols/Gemfile',
contents.lines.map do |line|
if line =~ /sequent/
"gem 'sequent', path: '../../..'\n"
else
line
end
end.join,
)

Bundler.with_unbundled_env do
# Change default database configuration
Sequent.configuration.database_config_directory = File.join(path, 'db')
Expand All @@ -71,6 +81,7 @@
system 'bash', '-cex', <<~SCRIPT
cd blog-with_special-symbols
export SEQUENT_ENV=test
export BUNDLE_GEMFILE=./Gemfile
ruby_version=$(ruby -v | awk '{print $2}' | grep -o '^[0-9.]*')
echo "$ruby_version" > .ruby-version
Expand Down

0 comments on commit 39e95cb

Please sign in to comment.