Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix specs WIP #56

Merged
merged 4 commits into from

2 participants

Kris Selden Adam Hawkins
Kris Selden
Collaborator

add .travis.yml
organize spec_helper like rake-pipeline project
use MemoryManifest in filter specs

Kris Selden krisselden add .travis.yml
organize spec_helper like rake-pipeline project
use MemoryManifest in filter specs
7775b0b
Adam Hawkins

@kselden thanks for doing this. I had forgotten that rake-pipeline-web-filters tests would break against rake-pipeline 0.8.0.

Kris Selden krisselden merged commit b850810 into from
Adam Hawkins

Can you tell me what the bug is? IIRC neuter in master must have explicitly declared dependencies for it work correctly. This depends on your invocation. You have to pass :additional_dependencies or something like that to the constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 15, 2012
  1. Kris Selden

    add .travis.yml

    krisselden authored
    organize spec_helper like rake-pipeline project
    use MemoryManifest in filter specs
Commits on Nov 16, 2012
  1. Kris Selden
  2. Kris Selden

    six sass_filter_spec

    krisselden authored
  3. Kris Selden
This page is out of date. Refresh to see the latest.
13 .travis.yml
View
@@ -0,0 +1,13 @@
+rvm:
+ - 1.9.2
+ - 1.9.3
+ - ruby-head
+ - jruby-head
+
+bundler_args: --without docs
+
+install: npm install -g jade
+
+notifications:
+ email:
+ - wycats@gmail.com
9 Gemfile
View
@@ -1,7 +1,8 @@
-source "http://rubygems.org"
-
-# Specify your gem's dependencies in rake-pipeline-web-filters.gemspec
-gemspec
+source :rubygems
gem "rake-pipeline", :git => "git://github.com/livingsocial/rake-pipeline.git"
gem "pry"
+gem "pry-debugger"
+
+# Specify your gem's dependencies in rake-pipeline-web-filters.gemspec
+gemspec
3  spec/cache_buster_filter_spec.rb
View
@@ -1,5 +1,6 @@
describe "CacheBusterFilter" do
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
CacheBusterFilter ||= Rake::Pipeline::Web::Filters::CacheBusterFilter
let(:content) { "it doesn't matter" }
@@ -14,6 +15,8 @@
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [ input_file ]
filter.output_root = output_root
filter.rake_application = Rake::Application.new
3  spec/chained_filter_spec.rb
View
@@ -1,5 +1,6 @@
describe "ChainedFilter" do
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
ChainedFilter ||= Rake::Pipeline::Web::Filters::ChainedFilter
input_file1 = MemoryFileWrapper.new("/path", "input.js.strip_asserts.erb", "UTF-8", <<-CONTENT)
@@ -58,6 +59,8 @@ def generate_output(inputs, output)
)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [ file_wrapper ]
filter.output_root = "/output"
filter.rake_application = Rake::Application.new
3  spec/coffee_script_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "CoffeeScriptFilter" do
CoffeeScriptFilter ||= Rake::Pipeline::Web::Filters::CoffeeScriptFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:coffee_input) { <<-COFFEE }
x = 1;
@@ -46,6 +47,8 @@ def should_match(expected, output)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("input.coffee", coffee_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
3  spec/gzip_filter_spec.rb
View
@@ -5,6 +5,7 @@
describe "GzipFilter" do
GzipFilter ||= Rake::Pipeline::Web::Filters::GzipFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:input) { "(function(){console.log('gzip me')})();" }
@@ -18,6 +19,8 @@ def output_file(name)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("test.js", input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
3  spec/handlebars_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "HandlebarsFilter" do
HandlebarsFilter ||= Rake::Pipeline::Web::Filters::HandlebarsFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:handlebars_input) {
'<h1 class="title">{{title}}</h1>'
@@ -20,6 +21,8 @@ def output_file(name)
def setup_filter(filter, input_filename = "test.handlebars")
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file(input_filename, handlebars_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
9 spec/helpers_spec.rb
View
@@ -119,13 +119,8 @@ def filter
end
describe "ProjectHelpers" do
- def project
- @project ||= Rake::Pipeline::Project.new
- end
-
- def dsl
- @dsl ||= Rake::Pipeline::DSL::ProjectDSL.new(project)
- end
+ let(:project) { Rake::Pipeline::Project.new }
+ let(:dsl) { Rake::Pipeline::DSL::ProjectDSL.new(project) }
describe "register" do
it "registers filters per file name" do
3  spec/iife_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "IifeFilter" do
IifeFilter ||= Rake::Pipeline::Web::Filters::IifeFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:js_input) { <<-HERE }
var name = "Truckasaurus Gates";
@@ -22,6 +23,8 @@ def output_file(name)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("name.js", js_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
59 spec/jade_filter_spec.rb
View
@@ -1,8 +1,9 @@
describe "JadeFilter" do
JadeFilter ||= Rake::Pipeline::Web::Filters::JadeFilter
- MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
- let(:jade_input) {"""
+ let(:jade_input) {
+ """
!!! 5
html
head
@@ -10,12 +11,14 @@
body
h1 Hello
"""
-}
+ }
- let(:expected_html_output) {"""<!DOCTYPE html><html><head><title>Hello</title></head><body><h1>Hello</h1></body></html>"""
-}
+ let(:expected_html_output) {
+ """<!DOCTYPE html><html><head><title>Hello</title></head><body><h1>Hello</h1></body></html>"""
+ }
-let(:expected_prettified_html_output) {"""\
+ let(:expected_prettified_html_output) {
+ """\
<!DOCTYPE html>
<html>
<head>
@@ -25,48 +28,54 @@
<h1>Hello</h1>
</body>
</html>"""
-}
+ }
- def input_file(name, content)
- MemoryFileWrapper.new("/path/to/input", name, "UTF-8", content)
- end
+ let(:input_root) { File.expand_path('./input') }
+ let(:input_path) { 'index.jade' }
- def output_file(name)
- MemoryFileWrapper.new("/path/to/output", name, "UTF-8")
- end
+ let(:input_file) {
+ mkdir_p input_root
+ File.open(File.join(input_root, input_path), 'w+:UTF-8') {|file| file << jade_input }
+ Rake::Pipeline::FileWrapper.new(input_root, input_path, "UTF-8")
+ }
+
+ let(:output_root) { File.expand_path('./output') }
+ let(:output_path) { 'index.html' }
+
+ let(:output_file) {
+ Rake::Pipeline::FileWrapper.new(output_root, output_path, "UTF-8")
+ }
def setup_filter(filter, input=jade_input)
- filter.file_wrapper_class = MemoryFileWrapper
- filter.input_files = [input_file("index.jade", input)]
- filter.output_root = "/path/to/output"
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
+ filter.input_files = [input_file]
+ filter.output_root = output_root
filter.rake_application = Rake::Application.new
filter
end
it "generates output" do
filter = setup_filter JadeFilter.new
-
- filter.output_files.should == [output_file("index.html")]
+ filter.output_files.should == [output_file]
tasks = filter.generate_rake_tasks
tasks.each(&:invoke)
- file = MemoryFileWrapper.files["/path/to/output/index.html"]
- file.body.should == expected_html_output
- file.encoding.should == "UTF-8"
+ output_file.read.should == expected_html_output
+ output_file.encoding.should == "UTF-8"
end
it "prettifies output" do
filter = setup_filter JadeFilter.new :pretty => true
- filter.output_files.should == [output_file("index.html")]
+ filter.output_files.should == [output_file]
tasks = filter.generate_rake_tasks
tasks.each(&:invoke)
- file = MemoryFileWrapper.files["/path/to/output/index.html"]
- file.body.should == expected_prettified_html_output
- file.encoding.should == "UTF-8"
+ output_file.read.should == expected_prettified_html_output
+ output_file.encoding.should == "UTF-8"
end
describe "naming output files" do
3  spec/less_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "LessFilter" do
LessFilter ||= Rake::Pipeline::Web::Filters::LessFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:less_input) { <<-SCSS }
@blue: #3bbfce;
@@ -26,6 +27,8 @@ def output_file(name)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("border.less", less_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
3  spec/markdown_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "MarkdownFilter" do
MarkdownFilter ||= Rake::Pipeline::Web::Filters::MarkdownFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:markdown_input) { <<-MARKDOWN }
## This is an H2
@@ -33,6 +34,8 @@ def output_file(name)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("page.md", markdown_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
3  spec/minispade_filter_spec.rb
View
@@ -2,6 +2,7 @@
describe "MinispadeFilter" do
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
def input_file(contents="var foo = 'bar'; // last-line comment", path="/path/to/input", name="foo.js")
MemoryFileWrapper.new(path, name, "UTF-8", contents)
@@ -20,6 +21,8 @@ def input_file(contents="var foo = 'bar'; // last-line comment", path="/path/to/
def make_filter(input_file, *args)
filter = Rake::Pipeline::Web::Filters::MinispadeFilter.new(*args)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
14 spec/neuter_filter_spec.rb
View
@@ -2,6 +2,7 @@
describe "NeuterFilter" do
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
def make_input(name, data)
make_data(name, data)
@@ -19,10 +20,21 @@ def make_filter(input_files, *args)
filter = Rake::Pipeline::Web::Filters::NeuterFilter.new(*args)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = input_files
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
- filter.generate_rake_tasks.each(&:invoke)
+
+ tasks = filter.generate_rake_tasks
+
+ # TODO work around a bug in rakep THIS IS TEMPORARY
+ filter.rake_application.tasks.each do |task|
+ task.dynamic_prerequisites.each do |prereq|
+ filter.send :create_file_task, prereq
+ end
+ end
+ tasks.each(&:invoke)
filter
end
5 spec/sass_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "SassFilter" do
SassFilter ||= Rake::Pipeline::Web::Filters::SassFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:scss_input) { <<-SCSS }
$blue: #3bbfce;
@@ -36,6 +37,8 @@ def output_file(name)
def setup_filter(filter, input_files=nil)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = input_files || [input_file("border.scss", scss_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
@@ -133,6 +136,8 @@ def write_input_file(filename, contents='', root=tmp)
it "includes @imported files" do
filter = SassFilter.new
+ filter.last_manifest = MemoryManifest.new
+ filter.manifest = MemoryManifest.new
filter.input_files = [main]
filter.output_root = "#{tmp}/output"
filter.rake_application = Rake::Application.new
85 spec/spec_helper.rb
View
@@ -2,86 +2,11 @@
require "rake-pipeline"
require "rake-pipeline-web-filters"
-class Rake::Pipeline
- module SpecHelpers
-
- class MemoryFileWrapper < Struct.new(:root, :path, :encoding, :body)
- @@files = {}
- @@data = {}
-
- def self.files
- @@files
- end
-
- def self.data
- @@data
- end
-
- def with_encoding(new_encoding)
- self.class.new(root, path, new_encoding, body)
- end
-
- def fullpath
- File.join(root, path)
- end
-
- def create
- @@files[fullpath] = self
- self.body = ""
- yield
- end
-
- def read
- body || @@data[fullpath] || ""
- end
-
- def write(contents)
- self.body << contents
- end
- end
-
- # TODO: OS agnostic modules
- module FileUtils
- def mkdir_p(dir)
- system "mkdir", "-p", dir
- end
-
- def touch(file)
- system "touch", file
- end
-
- def rm_rf(dir)
- system "rm", "-rf", dir
- end
-
- def touch_p(file)
- dir = File.dirname(file)
- mkdir_p dir
- touch file
- end
-
- def age_existing_files
- old_time = Time.now - 10
- Dir[File.join(tmp, "**/*.js")].each do |file|
- File.utime(old_time, old_time, file)
- end
- end
- end
-
- module Filters
- ConcatFilter = Rake::Pipeline::ConcatFilter
- MemoryFileWrapper = Rake::Pipeline::SpecHelpers::MemoryFileWrapper
-
- class StripAssertsFilter < Rake::Pipeline::Filter
- def generate_output(inputs, output)
- inputs.each do |input|
- output.write input.read.gsub(%r{^\s*assert\(.*\)\s*;?\s*$}m, '')
- end
- end
- end
- end
- end
-end
+require "support/spec_helpers/file_utils"
+require "support/spec_helpers/filters"
+require "support/spec_helpers/input_helpers"
+require "support/spec_helpers/memory_file_wrapper"
+require "support/spec_helpers/memory_manifest"
RSpec.configure do |config|
original = Dir.pwd
3  spec/stylus_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "StylusFilter" do
StylusFilter ||= Rake::Pipeline::Web::Filters::StylusFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:styl_input) { <<-STYLUS }
border-radius()
@@ -36,6 +37,8 @@ def output_file(name)
def setup_filter(filter, input=styl_input)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("border.styl", input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
33 spec/support/spec_helpers/file_utils.rb
View
@@ -0,0 +1,33 @@
+class Rake::Pipeline
+ module SpecHelpers
+
+ # TODO: OS agnostic modules
+ module FileUtils
+ def mkdir_p(dir)
+ system "mkdir", "-p", dir
+ end
+
+ def touch(file)
+ system "touch", file
+ end
+
+ def rm_rf(dir)
+ system "rm", "-rf", dir
+ end
+
+ def touch_p(file)
+ dir = File.dirname(file)
+ mkdir_p dir
+ touch file
+ end
+
+ def age_existing_files
+ old_time = Time.now - 10
+ Dir[File.join(tmp, "**/*.js")].each do |file|
+ File.utime(old_time, old_time, file)
+ end
+ end
+ end
+
+ end
+end
37 spec/support/spec_helpers/filters.rb
View
@@ -0,0 +1,37 @@
+class Rake::Pipeline
+ module SpecHelpers
+
+ module Filters
+ ConcatFilter = Rake::Pipeline::ConcatFilter
+
+ class StripAssertsFilter < Rake::Pipeline::Filter
+ def generate_output(inputs, output)
+ inputs.each do |input|
+ output.write input.read.gsub(%r{^\s*assert\(.*\)\s*;?\s*$}m, '')
+ end
+ end
+ end
+
+ class DynamicImportFilter < Rake::Pipeline::Filter
+ def additional_dependencies(input)
+ includes(input)
+ end
+
+ def includes(input)
+ input.read.scan(/^@import\(\"(.*)\"\)$/).map(&:first).map do |inc|
+ File.join(input.root, "#{inc}.import")
+ end
+ end
+
+ def generate_output(inputs, output)
+ inputs.each do |input|
+ output.write input.read
+ includes(input).each do |inc|
+ output.write File.read(inc)
+ end
+ end
+ end
+ end
+ end
+ end
+end
23 spec/support/spec_helpers/input_helpers.rb
View
@@ -0,0 +1,23 @@
+class Rake::Pipeline
+ module SpecHelpers
+ module InputHelpers
+ def input_file(path, root=File.join(tmp, "app/assets"))
+ Rake::Pipeline::FileWrapper.new root, path
+ end
+
+ def output_file(path, root=File.join(tmp, "public"))
+ input_file(path, root)
+ end
+
+ def create_files(files)
+ Array(files).each do |file|
+ mkdir_p File.dirname(file.fullpath)
+
+ File.open(file.fullpath, "w") do |file|
+ file.write "// This is #{file.path}\n"
+ end
+ end
+ end
+ end
+ end
+end
38 spec/support/spec_helpers/memory_file_wrapper.rb
View
@@ -0,0 +1,38 @@
+class Rake::Pipeline
+ module SpecHelpers
+ class MemoryFileWrapper < Struct.new(:root, :path, :encoding, :body)
+ @@files = {}
+ @@data = {}
+
+ def self.files
+ @@files
+ end
+
+ def self.data
+ @@data
+ end
+
+ def with_encoding(new_encoding)
+ self.class.new(root, path, new_encoding, body)
+ end
+
+ def fullpath
+ File.join(root, path)
+ end
+
+ def create
+ @@files[fullpath] = self
+ self.body = ""
+ yield
+ end
+
+ def read
+ body || @@data[fullpath] || ""
+ end
+
+ def write(contents)
+ self.body << contents
+ end
+ end
+ end
+end
19 spec/support/spec_helpers/memory_manifest.rb
View
@@ -0,0 +1,19 @@
+class Rake::Pipeline
+ module SpecHelpers
+ class MemoryManifest
+ def initialize
+ @entries = {}
+ end
+
+ # Look up an entry by filename.
+ def [](key)
+ @entries[key]
+ end
+
+ # Set an entry
+ def []=(key, value)
+ @entries[key] = value
+ end
+ end
+ end
+end
3  spec/tilt_filter_spec.rb
View
@@ -1,5 +1,6 @@
describe "TiltFilter" do
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:input_files) {
[
@@ -20,6 +21,8 @@ def make_filter(*args)
input.sub(/\.(erb|str)$/, '.txt')
end
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = input_files
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
3  spec/uglify_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "UglifyFilter" do
UglifyFilter ||= Rake::Pipeline::Web::Filters::UglifyFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:js_input) { <<-HERE }
var name = "Truckasaurus Gates";
@@ -25,6 +26,8 @@ def output_file(name)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("name.js", js_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
3  spec/yui_css_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "YUICssFilter" do
YUICssFilter ||= Rake::Pipeline::Web::Filters::YUICssFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:css_input) { <<-HERE }
div.error {
@@ -29,6 +30,8 @@ def output_file(name)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("error.css", css_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
3  spec/yui_javascript_filter_spec.rb
View
@@ -1,6 +1,7 @@
describe "YUIJavaScriptFilter" do
YUIFilter ||= Rake::Pipeline::Web::Filters::YUIJavaScriptFilter
MemoryFileWrapper ||= Rake::Pipeline::SpecHelpers::MemoryFileWrapper
+ MemoryManifest ||= Rake::Pipeline::SpecHelpers::MemoryManifest
let(:js_input) { <<-HERE }
var name = "Truckasaurus Gates";
@@ -25,6 +26,8 @@ def output_file(name)
def setup_filter(filter)
filter.file_wrapper_class = MemoryFileWrapper
+ filter.manifest = MemoryManifest.new
+ filter.last_manifest = MemoryManifest.new
filter.input_files = [input_file("name.js", js_input)]
filter.output_root = "/path/to/output"
filter.rake_application = Rake::Application.new
Something went wrong with that request. Please try again.