Commit 89ea2d01 by tady

teaspoon with coffeescript

parent b5c44df1
......@@ -90,6 +90,7 @@ group :development, :test do
gem 'database_rewinder'
gem 'teaspoon'
gem 'guard-teaspoon'
end
group :test do
......
......@@ -143,6 +143,9 @@ GEM
guard-rubocop (1.0.2)
guard (~> 2.0)
rubocop (~> 0.10)
guard-teaspoon (0.0.4)
guard (>= 1.6.1)
teaspoon (>= 0.5.3)
hashie (2.0.5)
hike (1.2.3)
htmlentities (4.3.1)
......@@ -386,6 +389,7 @@ DEPENDENCIES
github-markdown
guard-rspec
guard-rubocop
guard-teaspoon
i18n_generators
jbuilder
jquery-rails
......
......@@ -16,3 +16,7 @@ guard :rspec do
watch(%r{^spec/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end
guard :teaspoon do
watch(%r{^app/assets/javascripts/(.+).js}) { |m| "spec/javascripts/#{m[1]}_spec.js.coffee" }
watch(%r{^spec/javascripts/(.*)})
end
# TODO:
# mod-mdEditorがページ内に複数あった場合の処理
@_mod_md_editor = {}
class @_mod_md_editor.TextareaText
constructor: (@text, @sel_start, @sel_end) ->
total_line_num: ->
99
current_line_num: ->
80
current_line_head_pos: ->
70
current_pos_in_line: ->
4
$.fn.extend
mod_mdEditor: (options) ->
settings =
......@@ -8,7 +23,7 @@ $.fn.extend
end_point: ''
settings = $.extend settings, options
return @each ()->
return @each () ->
$root = $(@)
$textarea = $root.find('.mod-mdEditor-textarea')
......
// require jquery
describe("My great feature", function() {
it("will change the world", function() {
expect(true).toBe(true);
expect(jQuery).toBeDefined();
});
});
#= require modules/mod-md-editor
describe "mod-md-editor", ->
text = new _mod_md_editor.TextareaText("aaaaaaaa\nbbbbbb\n\ncccccc", 10, 18)
it "_mod_md_editor.parse", ->
expect(text.total_line_num()).toBe(4)
expect(text.current_line_num()).toBe()
expect(text.current_line_head_pos()).toBe(4)
expect(text.current_pos_in_line()).toBe(4)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment