Sha256: a19a1c40df18f26e0d7e8206b8ccf98c5f5d5f0180521c7562de9936053f326c
Contents?: true
Size: 1.12 KB
Versions: 4
Compression:
Stored size: 1.12 KB
Contents
require 'helper' class Closed end class TestPeto < Test::Unit::TestCase context "Master instance" do setup do @peto = Peto::Master.new end context "load contract yaml file" do setup do @peto.load("test/contracts/loading.yml") end should ".contract returns loaded contract" do assert_equal({ "name" => "loading" }, @peto.contract) end end context "generate procedures" do setup do @peto.load("test/contracts/generating.yml") end should "returns string by loaded contract" do assert_equal String, @peto.generate.class end end end context "Generated ruby script" do setup do @peto = Peto::Master.new @peto.load("test/contracts/generating.yml") @generated = @peto.generate end should "is readable as ruby" do Closed.class_eval(@generated) assert_equal({ :procedure => "do_a", :args => { :a => 1, :b => "two", :c => {:foo=>"foo"}, } }, Closed::Peto::Generating.do_a(1, "two", Closed::Peto::TypeB.new(:foo=>"foo"))) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
peto-0.1.3 | test/test_peto.rb |
peto-0.1.2 | test/test_peto.rb |
peto-0.1.1 | test/test_peto.rb |
peto-0.1.0 | test/test_peto.rb |