This repository has been archived by the owner on Jun 16, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test coverage and cleanup in anticipation of merge
- Loading branch information
Showing
10 changed files
with
109 additions
and
29 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 |
---|---|---|
|
@@ -14,3 +14,4 @@ jhw-test | |
.jhw-cache/ | ||
_site/ | ||
jhw.*.html | ||
coverage/ |
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 |
---|---|---|
|
@@ -17,3 +17,5 @@ gem 'facter' | |
|
||
gem 'jquery-rails' | ||
gem 'ejs' | ||
|
||
gem 'simplecov' |
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,20 @@ | ||
module Digest | ||
class JasmineTest | ||
def self.file(file) | ||
new | ||
end | ||
|
||
def file(file) | ||
self | ||
end | ||
|
||
def hexdigest | ||
'test' | ||
end | ||
|
||
def update(prefix) | ||
self | ||
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
require 'jasmine/headless' | ||
require 'jasmine/headless/railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3 | ||
|
||
module Digest | ||
autoload :JasmineTest, 'digest/jasmine_test' | ||
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
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,25 @@ | ||
require 'spec_helper' | ||
|
||
describe Jasmine::Headless::CSSTemplate do | ||
include FakeFS::SpecHelpers | ||
|
||
let(:template) { described_class.new(file) { data } } | ||
let(:file) { 'file' } | ||
let(:data) { 'data' } | ||
|
||
subject { template.render } | ||
|
||
before do | ||
File.open(file, 'wb') if file | ||
end | ||
|
||
context "no file'" do | ||
let(:file) { nil } | ||
|
||
it { should == data } | ||
end | ||
|
||
context 'file' do | ||
it { should == %{<link rel="stylesheet" href="#{file}" type="text/css" />} } | ||
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,31 @@ | ||
require 'spec_helper' | ||
|
||
describe Jasmine::Headless::JSTemplate do | ||
include FakeFS::SpecHelpers | ||
|
||
let(:template) { described_class.new(file) { data } } | ||
let(:file) { 'file' } | ||
let(:data) { 'data' } | ||
|
||
subject { template.render } | ||
|
||
before do | ||
File.open(file, 'wb') if file | ||
end | ||
|
||
context "no file'" do | ||
let(:file) { nil } | ||
|
||
it { should == data } | ||
end | ||
|
||
context 'file' do | ||
it { should == %{<script type="text/javascript" src="#{file}"></script>} } | ||
end | ||
|
||
context 'jhw content' do | ||
let(:data) { 'from="jhw"' } | ||
|
||
it { should == data } | ||
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,21 @@ | ||
require 'spec_helper' | ||
|
||
describe Jasmine::Headless::JSTTemplate do | ||
include FakeFS::SpecHelpers | ||
|
||
let(:template) { described_class.new(file) } | ||
let(:file) { 'file' } | ||
let(:data) { 'data' } | ||
|
||
let(:context) { stub(:logical_path => 'path') } | ||
|
||
before do | ||
File.open(file, 'wb') { |fh| fh.print data } | ||
end | ||
|
||
subject { template.render(context) } | ||
|
||
it { should include(%{<script type="text/javascript">}) } | ||
it { should include(data) } | ||
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