Skip to content

Commit

Permalink
Add task to install mjml and compile templates for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykola Basov committed Aug 31, 2016
1 parent 48f8140 commit f636a9b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 73 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ test/tmp
test/version_tmp
tmp
.byebug_history
spec/fixtures/*.html

# YARD artifacts
.yardoc
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ notifications:
email: false

before_script:
- nvm install 6.5
- nvm use 6.5
- npm install
- nvm install node
- nvm use node
- rake prepare
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ Rake::TestTask.new do |t|
end

task default: :test

# Prepare env for tests
task :prepare do
system 'npm install -g mjml@^2.3.3'
template_path = "#{Dir.pwd}/spec/fixtures/hello"
system "mjml #{template_path}.mjml -o #{template_path}.html"
end
2 changes: 1 addition & 1 deletion lib/mjml/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def mjml_bin
end

def mjml_version
ver = `#{mjml_bin} -V`.strip
ver, _status = Open3.capture2(mjml_bin, '-V')
(ver =~ VERSION_REGEX).nil? ? nil : ver
end
end
Expand Down
19 changes: 0 additions & 19 deletions package.json

This file was deleted.

50 changes: 0 additions & 50 deletions spec/fixtures/hello.html

This file was deleted.

0 comments on commit f636a9b

Please sign in to comment.