2011-12-05 23:49:52 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Jasmine::Headless::FileChecker do
|
|
|
|
include FakeFS::SpecHelpers
|
2011-12-06 14:31:23 +00:00
|
|
|
|
2011-12-05 23:49:52 +00:00
|
|
|
let(:test_class) do
|
|
|
|
object = Object.new
|
|
|
|
object.class.send(:include, Jasmine::Headless::FileChecker)
|
|
|
|
object
|
|
|
|
end
|
2011-12-06 14:31:23 +00:00
|
|
|
|
2011-12-05 23:49:52 +00:00
|
|
|
context "bad_format?" do
|
|
|
|
it "should return false wth correct format" do
|
|
|
|
test_class.bad_format?('foobar.js').should be_false
|
|
|
|
end
|
2011-12-06 14:31:23 +00:00
|
|
|
|
2011-12-05 23:49:52 +00:00
|
|
|
it "should return false wth wrong format" do
|
|
|
|
test_class.bad_format?('foobar.js.erb').should be_true
|
|
|
|
end
|
|
|
|
|
2011-12-06 14:31:23 +00:00
|
|
|
it "should check for the whole extension" do
|
|
|
|
test_class.bad_format?('foobar.string.js').should be_false
|
|
|
|
end
|
|
|
|
end
|
2011-12-05 23:49:52 +00:00
|
|
|
end
|