Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.swp | ||
*.gem | ||
*.gem | ||
.bundle | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source :rubygems | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'spec_helper' | ||
|
||
describe CoffeeViews::Handlers::CoffeeScript do | ||
|
||
def prepare source | ||
subject.prepare(source) | ||
end | ||
|
||
describe "Without substitutions" do | ||
it "should work with empty source" do | ||
prepare('').should == '' | ||
prepare(nil).should == '' | ||
end | ||
|
||
it "should prepare sources" do | ||
prepare("x").should == "x" | ||
end | ||
end | ||
|
||
describe "<%= code %>" do | ||
it "should wrap with `` and call #to_json on code" do | ||
prepare("<%=x%>").should == "`<%==(x).to_json%>`" | ||
end | ||
end | ||
|
||
describe "<%%>" do | ||
it "should wrap with ``" do | ||
prepare("<%x%>").should == "`<%x%>`" | ||
end | ||
end | ||
|
||
describe "<%==%>" do | ||
it "should wrap with ``" do | ||
prepare("<%==x%>").should == "`<%==x%>`" | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$LOAD_PATH.unshift(File.dirname(__FILE__)) | ||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib")) | ||
|
||
require 'coffee-views' |