浏览代码

Made crystal spec tests run the code

master
Ludovic 'Archivist' Lagouardette 5 年前
父节点
当前提交
7ae828e182
共有 2 个文件被更改,包括 11 次插入6 次删除
  1. +5
    -4
      spec/andrew_spec.cr
  2. +6
    -2
      src/andrew.cr

+ 5
- 4
spec/andrew_spec.cr 查看文件

@ -1,9 +1,10 @@
require "./spec_helper"
describe Andrew do
# TODO: Write tests
it "works" do
false.should eq(true)
it "generate record.yml" do
File.open("tests/record.yml") do |file|
fg = FileGenerator.from_yaml(file)
end
true.should eq(true)
end
end

+ 6
- 2
src/andrew.cr 查看文件

@ -128,6 +128,10 @@ class AttributeAfterGenerator
end
end
File.open(ARGV[0]) do |file|
puts FileGenerator.from_yaml(file).to_s
if(ARGV.size != 0)
File.open(ARGV[0]) do |file|
puts FileGenerator.from_yaml(file).to_s
end
else
puts "Andrew code generator\n\tExpects a single YAML file as argument"
end

正在加载...
取消
保存