Switched to jasminrice for coffee specs
parent
c61199b4c9
commit
4e5240e24f
@ -1,22 +1,28 @@
|
||||
# A sample Guardfile
|
||||
# More info at https://github.com/guard/guard#readme
|
||||
|
||||
# Run JS and CoffeeScript files in a typical Rails 3.1 fashion, placing Underscore templates in app/views/*.jst
|
||||
# Your spec files end with _spec.{js,coffee}.
|
||||
# # Run JS and CoffeeScript files in a typical Rails 3.1 fashion, placing Underscore templates in app/views/*.jst
|
||||
# # Your spec files end with _spec.{js,coffee}.
|
||||
|
||||
spec_location = "spec/javascripts/%s_spec"
|
||||
# spec_location = "spec/javascripts/%s_spec"
|
||||
|
||||
# uncomment if you use NerdCapsSpec.js
|
||||
# spec_location = "spec/javascripts/%sSpec"
|
||||
# # uncomment if you use NerdCapsSpec.js
|
||||
# # spec_location = "spec/javascripts/%sSpec"
|
||||
|
||||
guard 'jasmine-headless-webkit' do
|
||||
# watch(%r{^app/views/.*\.jst$})
|
||||
# guard 'jasmine-headless-webkit' do
|
||||
# # watch(%r{^app/views/.*\.jst$})
|
||||
|
||||
watch(%r{^app/assets/javascripts/(.*?)\..*}) do |m|
|
||||
newest_js_file("spec/javascripts/#{m[1]}_spec")
|
||||
end
|
||||
# watch(%r{^app/assets/javascripts/(.*?)\..*}) do |m|
|
||||
# newest_js_file("spec/javascripts/#{m[1]}_spec")
|
||||
# end
|
||||
|
||||
watch(%r{^spec/javascripts/(.*)_spec\..*}) do |m|
|
||||
newest_js_file(spec_location % m[1])
|
||||
end
|
||||
# watch(%r{^spec/javascripts/(.*)_spec\..*}) do |m|
|
||||
# newest_js_file(spec_location % m[1])
|
||||
# end
|
||||
# end
|
||||
|
||||
guard 'jasmine' do
|
||||
watch(%r{app/assets/javascripts/(.+)\.(js\.coffee|js|coffee)$}) { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
|
||||
watch(%r{spec/javascripts/(.+)_spec\.(js\.coffee|js|coffee)$}) { |m| puts m.inspect; "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
|
||||
watch(%r{spec/javascripts/spec\.(js\.coffee|js|coffee)$}) { "spec/javascripts" }
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
describe AsciiIo.Brush, ->
|
||||
describe 'AsciiIo.Brush', ->
|
||||
|
||||
describe '.clearCache', ->
|
||||
|
@ -1,4 +1,4 @@
|
||||
describe AsciiIo.HudView, ->
|
||||
describe 'AsciiIo.HudView', ->
|
||||
|
||||
describe 'constructor', ->
|
||||
it 'creates child elements', ->
|
@ -1,3 +0,0 @@
|
||||
describe AsciiIo.ScreenBuffer, ->
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
describe 'AsciiIo.ScreenBuffer', ->
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
describe AsciiIo.TerminalView, ->
|
||||
describe 'AsciiIo.TerminalView', ->
|
||||
|
||||
describe 'constructor', ->
|
||||
it 'creates child elements', ->
|
@ -1,22 +1,33 @@
|
||||
describe AsciiIo.VT, ->
|
||||
describe 'AsciiIo.VT', ->
|
||||
vt = renderer = data = undefined
|
||||
cols = 80
|
||||
lines = 24
|
||||
|
||||
isSwallowed = (d) ->
|
||||
# vt = new AsciiIo.VT(cols, lines, renderer)
|
||||
vt.sb = {} # will throw 'undefined is not a function'
|
||||
vt.sb = # will throw 'undefined is not a function' for anything else
|
||||
changes: ->
|
||||
clearChanges: ->
|
||||
|
||||
expect(vt.feed(d || data)).toEqual(true)
|
||||
|
||||
beforeEach ->
|
||||
console.log 'kurwa'
|
||||
console.log AsciiIo.TerminalView
|
||||
renderer = new AsciiIo.TerminalView({ cols: cols, lines: lines })
|
||||
vt = new AsciiIo.VT(cols, lines, renderer)
|
||||
console.log vt
|
||||
data = ''
|
||||
|
||||
describe '#feed', ->
|
||||
it 'renders and clears buffer changes', ->
|
||||
changes = { someChanges: 'here' }
|
||||
spyOn vt.renderer, 'render'
|
||||
spyOn(vt.sb, 'changes').andReturn(changes)
|
||||
spyOn(vt.sb, 'clearChanges')
|
||||
|
||||
vt.feed('')
|
||||
|
||||
expect(vt.renderer.render).toHaveBeenCalledWith(changes, vt.sb.cursorX,
|
||||
vt.sb.cursorY)
|
||||
expect(vt.sb.clearChanges).toHaveBeenCalled()
|
||||
|
||||
describe 'C0 set control character', ->
|
||||
# A single character with an ASCII code within the ranges: 000 to 037 and
|
||||
# 200 to 237 octal, 00 - 1F and 80 - 9F hex.
|
@ -0,0 +1,3 @@
|
||||
/*
|
||||
*= require application
|
||||
*/
|
@ -0,0 +1,2 @@
|
||||
#= require application
|
||||
#= require_tree .
|
@ -1,79 +0,0 @@
|
||||
# src_files
|
||||
#
|
||||
# Return an array of filepaths relative to src_dir to include before jasmine specs.
|
||||
# Default: []
|
||||
#
|
||||
# EXAMPLE:
|
||||
#
|
||||
# src_files:
|
||||
# - lib/source1.js
|
||||
# - lib/source2.js
|
||||
# - dist/**/*.js
|
||||
#
|
||||
src_files:
|
||||
- application.js
|
||||
# - "**/*.*"
|
||||
|
||||
# stylesheets
|
||||
#
|
||||
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
|
||||
# Default: []
|
||||
#
|
||||
# EXAMPLE:
|
||||
#
|
||||
# stylesheets:
|
||||
# - css/style.css
|
||||
# - stylesheets/*.css
|
||||
#
|
||||
# stylesheets:
|
||||
# - stylesheets/**/*.css
|
||||
|
||||
# helpers
|
||||
#
|
||||
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
|
||||
# Default: ["helpers/**/*.js"]
|
||||
#
|
||||
# EXAMPLE:
|
||||
#
|
||||
# helpers:
|
||||
# - helpers/**/*.js
|
||||
#
|
||||
helpers:
|
||||
- helpers/**/*
|
||||
|
||||
# spec_files
|
||||
#
|
||||
# Return an array of filepaths relative to spec_dir to include.
|
||||
# Default: ["**/*[sS]pec.js"]
|
||||
#
|
||||
# EXAMPLE:
|
||||
#
|
||||
# spec_files:
|
||||
# - **/*[sS]pec.js
|
||||
#
|
||||
spec_files:
|
||||
- "**/*[Ss]pec.*"
|
||||
|
||||
# src_dir
|
||||
#
|
||||
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
|
||||
# Default: project root
|
||||
#
|
||||
# EXAMPLE:
|
||||
#
|
||||
# src_dir: public
|
||||
#
|
||||
src_dir:
|
||||
- app/assets/javascripts
|
||||
- vendor/assets/javascripts
|
||||
|
||||
# spec_dir
|
||||
#
|
||||
# Spec directory path. Your spec_files must be returned relative to this path.
|
||||
# Default: spec/javascripts
|
||||
#
|
||||
# EXAMPLE:
|
||||
#
|
||||
# spec_dir: spec/javascripts
|
||||
#
|
||||
spec_dir: spec/javascripts
|
@ -1,23 +0,0 @@
|
||||
module Jasmine
|
||||
class Config
|
||||
|
||||
# Add your overrides or custom config code here
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Note - this is necessary for rspec2, which has removed the backtrace
|
||||
module Jasmine
|
||||
class SpecBuilder
|
||||
def declare_spec(parent, spec)
|
||||
me = self
|
||||
example_name = spec["name"]
|
||||
@spec_ids << spec["id"]
|
||||
backtrace = @example_locations[parent.description + " " + example_name]
|
||||
parent.it example_name, {} do
|
||||
me.report_spec(spec["id"])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,32 +0,0 @@
|
||||
$:.unshift(ENV['JASMINE_GEM_PATH']) if ENV['JASMINE_GEM_PATH'] # for gem testing purposes
|
||||
|
||||
require 'rubygems'
|
||||
require 'jasmine'
|
||||
jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config.rb'))
|
||||
require jasmine_config_overrides if File.exist?(jasmine_config_overrides)
|
||||
if Jasmine::Dependencies.rspec2?
|
||||
require 'rspec'
|
||||
else
|
||||
require 'spec'
|
||||
end
|
||||
|
||||
jasmine_config = Jasmine::Config.new
|
||||
spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
|
||||
|
||||
should_stop = false
|
||||
|
||||
if Jasmine::Dependencies.rspec2?
|
||||
RSpec.configuration.after(:suite) do
|
||||
spec_builder.stop if should_stop
|
||||
end
|
||||
else
|
||||
Spec::Runner.configure do |config|
|
||||
config.after(:suite) do
|
||||
spec_builder.stop if should_stop
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
spec_builder.start
|
||||
should_stop = true
|
||||
spec_builder.declare_suites
|
Loading…
Reference in New Issue