Sha256: fe123fb7622387ff4a4ab8b59d8077da9aa3aebf52b5004ab8d93d5740bbe0f7

Contents?: true

Size: 988 Bytes

Versions: 2

Compression:

Stored size: 988 Bytes

Contents

require 'spec_helper'

describe Sibilant do
  describe 'with an instance of sibilant compiler' do
    before(:each) { @compiler = Sibilant::Compiler.new }

    it 'should exist' do
      @compiler.should_not be_nil
    end

    it 'should have a #js_root that ends with js' do
      @compiler.sibilant_js_root.should match(/\/js\/sibilant$/)
    end

    it 'should have a package_json_file' do
      @compiler.package_json_file.should be_a(File)
    end

    it 'should properly parse the json from the #package_json_file as #package_json' do
      @compiler.package_json['name'].should == 'sibilant'
    end

    it 'should properly translate sibilant' do
      @compiler.translate('(console.log "foo")').should == 'console.log("foo");'
    end

    it 'should pull the #version from the #package_json' do
      test_version = '9.8.6'

      @compiler.should_receive(:package_json).once.and_return version: test_version
      @compiler.version.should eq(test_version)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sibilant-0.0.2 spec/sibilant_spec.rb
sibilant-0.0.1 spec/sibilant_spec.rb