Fix scripts and tests
* Fix the reformat script to work with recent changes * Fix the convert-nei-dump script to remove leading and trailing '_' * Fix various broken tests
This commit is contained in:
@@ -19,7 +19,7 @@ modPack = plan = null
|
||||
describe 'CraftingPlan', ->
|
||||
|
||||
beforeEach ->
|
||||
mod = new Mod name:'Minecraft'
|
||||
mod = new Mod name:'Minecraft', slug:'minecraft'
|
||||
mod.addModVersion new ModVersion modSlug:mod.slug, version:'1.7.10'
|
||||
mod.activeModVersion.parse """
|
||||
schema:1
|
||||
|
||||
@@ -15,16 +15,16 @@ mod = null
|
||||
|
||||
describe 'Mod', ->
|
||||
|
||||
beforeEach -> mod = new Mod name:'Test'
|
||||
beforeEach -> mod = new Mod name:'Test', slug:'test'
|
||||
|
||||
describe 'compareTo', ->
|
||||
|
||||
it 'lists required mods first', ->
|
||||
minecraft = new Mod name:'Minecraft'
|
||||
minecraft = new Mod name:'Minecraft', slug:'minecraft'
|
||||
mod.compareTo(minecraft).should.equal +1
|
||||
minecraft.compareTo(mod).should.equal -1
|
||||
|
||||
it 'sorts by name second', ->
|
||||
buildcraft = new Mod name:'Buildcraft'
|
||||
buildcraft = new Mod name:'Buildcraft', slug:'buildcraft'
|
||||
mod.compareTo(buildcraft).should.equal +1
|
||||
buildcraft.compareTo(mod).should.equal -1
|
||||
|
||||
@@ -19,19 +19,19 @@ buildcraft = industrialCraft = minecraft = modPack = null
|
||||
describe 'ModPack', ->
|
||||
|
||||
beforeEach ->
|
||||
minecraft = new Mod name:'Minecraft'
|
||||
minecraft = new Mod slug:'minecraft'
|
||||
minecraft.addModVersion new ModVersion modSlug:minecraft.slug, version:'1.7.10'
|
||||
minecraft.activeModVersion.addItem new Item name:'Wool'
|
||||
minecraft.activeModVersion.addItem new Item name:'Bed', recipes:['']
|
||||
minecraft.activeModVersion.registerSlug 'iron_chestplate', 'Iron Chestplate'
|
||||
|
||||
buildcraft = new Mod name:'Buildcraft'
|
||||
buildcraft = new Mod slug:'buildcraft'
|
||||
buildcraft.addModVersion new ModVersion modSlug:buildcraft.slug, version:'6.2.6'
|
||||
buildcraft.activeModVersion.addItem new Item name:'Stone Gear', recipes:['']
|
||||
buildcraft.activeModVersion.addItem new Item name:'Bed', recipes:['']
|
||||
buildcraft.activeVersion = Mod.Version.None
|
||||
|
||||
industrialCraft = new Mod name:'Industrial Craft'
|
||||
industrialCraft = new Mod slug:'industrial_craft'
|
||||
industrialCraft.addModVersion new ModVersion modSlug:industrialCraft.slug, version:'2.0'
|
||||
industrialCraft.activeModVersion.addItem new Item name:'Resin'
|
||||
industrialCraft.activeModVersion.addItem new Item name:'Rubber'
|
||||
@@ -57,7 +57,7 @@ describe 'ModPack', ->
|
||||
it 'returns all data for a regular Minecraft item', ->
|
||||
display = modPack.findItemDisplay 'bed'
|
||||
display.iconUrl.should.equal '/data/minecraft/1.7.10/images/bed.png'
|
||||
display.itemUrl.should.equal '/item/Bed'
|
||||
display.itemUrl.should.equal '/item/bed'
|
||||
display.itemName.should.equal 'Bed'
|
||||
display.modSlug.should.equal 'minecraft'
|
||||
|
||||
@@ -65,13 +65,13 @@ describe 'ModPack', ->
|
||||
buildcraft.activeVersion = '6.2.6'
|
||||
display = modPack.findItemDisplay 'stone_gear'
|
||||
display.iconUrl.should.equal '/data/buildcraft/6.2.6/images/stone_gear.png'
|
||||
display.itemUrl.should.equal '/item/Stone%20Gear'
|
||||
display.itemUrl.should.equal '/item/stone_gear'
|
||||
display.itemName.should.equal 'Stone Gear'
|
||||
display.modSlug.should.equal 'buildcraft'
|
||||
|
||||
it 'assumes an unfound item is from Minecraft', ->
|
||||
display = modPack.findItemDisplay 'iron_chestplate'
|
||||
display.iconUrl.should.equal '/data/minecraft/1.7.10/images/iron_chestplate.png'
|
||||
display.itemUrl.should.equal '/item/Iron%20Chestplate'
|
||||
display.itemUrl.should.equal '/item/iron_chestplate'
|
||||
display.itemName.should.equal 'Iron Chestplate'
|
||||
display.modSlug.should.equal 'minecraft'
|
||||
|
||||
Reference in New Issue
Block a user