Browse Source

Made crystal spec tests run the code

master
Ludovic 'Archivist' Lagouardette 5 years ago
parent
commit
7ae828e182
2 changed files with 11 additions and 6 deletions
  1. +5
    -4
      spec/andrew_spec.cr
  2. +6
    -2
      src/andrew.cr

+ 5
- 4
spec/andrew_spec.cr View File

@ -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 View File

@ -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

Loading…
Cancel
Save