Skip to content

Test/Dev Environment Changes - #243

Open
alunny wants to merge 4 commits into
documentcloud:masterfrom
alunny:dev_environment
Open

Test/Dev Environment Changes#243
alunny wants to merge 4 commits into
documentcloud:masterfrom
alunny:dev_environment

Conversation

@alunny

Copy link
Copy Markdown

A few changes intended to make Jammit easier to hack on, and easier to run in Ruby 1.9. Details are summarized in the commit messages, but the main things are making the tests 1.9 compatible and making dependencies explicit (and/or updated).

* move `test/unit/command_line_test` to
`test/integration/test_command_line`
* require `test_helper` in all test files and require `test/unit` in
test_helper
this allows any test file to be run individually as:
`ruby test/unit/test_uglifier.rb`
* modify `test/unit/jammit_helpers` to force rails 2.3 compatibility
with ruby 1.9.3
* modify `test/integration/test_command_line` to resolve asset paths
correctly, and to make debugging a bit easier (still has a couple
failing tests)
* modify `test/configuration` to work with ruby 1.9's unicode-by-default
strings
* explicitly ignore Gemfile.lock
* update sass to work with 6f0c096
* change redgreen require (from b6dd1b1) to always require - it should
be present after `bundle install`, and the `Gem` method isn't supported
in all environments
* add yard as a development dependency
* require rubygems explicitly, to avoid weirdness in some environments
* only declare Jammit::VERSION in one place
* remove `sudo` from rake tasks - it doesn't play well with tools like
rvm, and it's easy to run the whole command as sudo
* isolate Jammit::VERSION into single file (easy to require)
* remove redgreen from Rakefile (contentious?)
* remove -rrubygems from bin/jammit - use inline require
* use `bundle exec` path in tests
1) mtime was not being modified when `--force` was set on command line
This has now been fixed - the force option now overrides Jammit's mtime
niceties
2) newlines for JSTs were improperly described in the tests - the JS
file, including templates and the JST definition, have all literal
newlines stripped, but newlines inside of strings (in the templates
themselves) are not stripped. Since calling jammit on the CLI treats the
whole output as a JS file, the fixture for the `pack_templates` unit
test was not appropriate for the CLI test
@alunny

Copy link
Copy Markdown
Author

Added a couple new commits for travis CI integration (would need to be set up for documentcloud/jammit, which I don't have admin over). Changes are:

  • ensure it runs on Travis (basically using bundle exec everywhere) - 2930f18
  • ensure all the tests pass - c73f240

@andrewhao

Copy link
Copy Markdown

I'm liking the Travis integration here.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@alunny@andrewhao