Skip to content

Commit

Permalink
snippet specs
Browse files Browse the repository at this point in the history
  • Loading branch information
demental committed Apr 8, 2014
1 parent cb1e175 commit 5656ffd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/generators/snippet_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require_relative 'generators_helper'
require 'locomotive/wagon/generators/snippet'

describe Locomotive::Wagon::Generators::Snippet do
let(:target_path) { Dir.mktmpdir }
before { subject.create_snippet }
after { FileUtils.remove_entry_secure target_path }

subject { Locomotive::Wagon::Generators::Snippet.new(args, {}, {}) }

context 'regular arguments' do
let(:args) { [ 'weather-forecast', target_path, [] ] }
let(:snippet_file) { File.join target_path, 'app','views','snippets','weather_forecast.liquid' }
let(:expected_data) { { 'title'=>'About-us', 'listed'=>true, 'published'=>true } }

it 'generates a snippet file' do
File.exists?(snippet_file).should be_true
end
end
end

0 comments on commit 5656ffd

Please sign in to comment.