Skip to content

Instantly share code, notes, and snippets.

@asok
Last active December 10, 2015 00:39
Show Gist options
  • Save asok/4352610 to your computer and use it in GitHub Desktop.
Save asok/4352610 to your computer and use it in GitHub Desktop.
Scenario: html-erb-mode not working
Given I have master of mmm-mode in "~/mmm-mode" directory
And I have file "test.el" with content:
'''
(add-to-list 'load-path "~/mmm-mode/")
(require 'mmm-auto)
(require 'mmm-erb)
(setq mmm-global-mode 'auto)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-js)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-css)
(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb)
(mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs)
(add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . html-erb-mode))
(add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode))
'''
When I run "emacs -q -l test.el"
And I open html.erb file
Then mmm-mode picks up ruby part of the buffer
But not js part of the buffer
Scenario: html-erb-mode working
Given I have master of mmm-mode in "~/mmm-mode" directory
And I have file "test.el" with content:
'''
(add-to-list 'load-path "~/mmm-mode/")
(require 'mmm-auto)
(require 'mmm-erb)
(setq mmm-global-mode 'auto)
(mmm-add-mode-ext-class 'html-erb-mode "\\.html\\.erb\\'" 'erb)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-js)
(mmm-add-mode-ext-class 'html-erb-mode nil 'html-css)
(mmm-add-mode-ext-class 'html-erb-mode "\\.jst\\.ejs\\'" 'ejs)
(add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . html-erb-mode))
(add-to-list 'auto-mode-alist '("\\.jst\\.ejs\\'" . html-erb-mode))
'''
When I run "emacs -q -l test.el"
And I open html.erb file
Then mmm-mode picks up ruby part of the buffer
And js part of the buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment