{"size": 666, "ext": "js", "max_stars_repo_path": "test/view.compile.js", "max_stars_repo_name": "jonschlinkert/vinyl-view", "max_stars_repo_stars_event_min_datetime": "2016-06-01T22:36:17.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-12T22:32:18.000Z", "max_issues_repo_path": "test/view.compile.js", "max_issues_repo_name": "jonschlinkert/vinyl-view", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/view.compile.js", "max_forks_repo_name": "jonschlinkert/vinyl-view", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.6666666667, "max_line_length": 64, "alphanum_fraction": 0.5960960961}
'use strict';

var fs = require('fs');
var path = require('path');
var assert = require('assert');
var View = require('..');

describe('.compile', function() {
  it('should expose a `.compile` method', function() {
    var view = new View();
    assert.equal(typeof view.compile, 'function');
  });

  it('should set a `fn` property on view', function() {
    var view = new View();
    view.compile();
    assert.equal(typeof view.fn, 'function');
  });

  it('should render templates from `view.content`', function() {
    var view = new View({content: 'a <%= name %> z'});

    view.compile();
    assert.equal(view.fn({name: 'Brooke'}), 'a Brooke z');
  });
});
