示例#1
0
    def test_var_name(self):
        result = make_from('var abc')

        self.assertEquals(result, " = require('${1:abc}')")
示例#2
0
    def test_requesting_double_quotes(self):
        result = make_from('abc', 'double')

        self.assertEquals(result, ' = require("${1:abc}")')
示例#3
0
    def test_requesting_unknown_quote_style(self):
        result = make_from('abc', 'blah')

        self.assertEquals(result, " = require('${1:abc}')")
示例#4
0
    def test_var_with_equals(self):
        result = make_from('var foo = ')

        self.assertEquals(result, "require('${1:}')")
示例#5
0
    def test_requesting_single_quotes(self):
        result = make_from('abc', 'single')

        self.assertEquals(result, " = require('${1:abc}')")
示例#6
0
    def test_empty_string(self):
        result = make_from('')

        self.assertEquals(result, "require('${1:}')")
示例#7
0
    def test_just_space(self):
        result = make_from('     ')

        self.assertEquals(result, "require('${1:}')")
示例#8
0
    def test_capitalized_name(self):
        result = make_from('Blah')

        self.assertEquals(result, " = require('${1:blah}')")
示例#9
0
    def test_camel_case_name(self):
        result = make_from('camelCaseBlah')

        self.assertEquals(result, " = require('${1:camel-case-blah}')")
示例#10
0
    def test_name_spaces(self):
        result = make_from('abc    ')

        self.assertEquals(result, "= require('${1:abc}')")