asciidoctor / asciidoctor-bibtex

Add bibtex citation support for asciidoc documents
Other
69 stars 27 forks source link

how to run the tests #41

Closed johannesjh closed 5 years ago

johannesjh commented 5 years ago

Can someone provide hints/directsions for how to run the tests? I am willing to contribute documentation once we get them to run. EDIT: Note that I am a beginner in ruby, so some of what is unclear to me might be easy for others.

Some problems I ran into, as well as suggestions for improvement:

  1. Running bundle install throws an error because the Gemfile is missing. Adding this very simple Gemfile should fix the isse:
source "http://www.rubygems.org"
gemspec
  1. I think some development dependencies should be added to the gemspec file. Specifically, rake and rspec need to be installed in order to be able to run the rakefile's spec task. I guess these lines should be added to asciidoctor-bibtex.gemspec:
  s.add_development_dependency "bundler", "~> 2.0"
  s.add_development_dependency "rake", "~> 12.0"
  s.add_development_dependency "rspec", "~> 3.0"
  1. Naming convention of test files. By default, the rake spec task looks for files named *_spec.rb. Since the tests in this repo are using a different naming convention, a different pattern needs to be specified in the Rakefile:
t.pattern = "test/*_test.rb"
  1. LoadErrors. When I then run bundle exec rake spec, then rspec suceeds in finding the test cases, but it throws a lot of load errors. Further investigation of the test_helpers.rb file suggests that simplecov and minitests are used in addition to rspec. That's when I gave up and started writing this ticket.
mojavelinux commented 5 years ago

As far as I understand, the tests in this project are not for this project. They got copied when the repository was forked from asciidoc-bib, but never updated after that. Feel free to correct me if that's mistaken.

ProgramFan commented 5 years ago

It is unfortunately true. I will try to add some tests this weekend.

mojavelinux commented 5 years ago

That's great news. Thanks!