简体   繁体   中英

How to load test data from test/fixtures yml file in Rails units

如何从Rails单元中的测试/夹具yml文件加载测试数据

fixtures/xxxs.yml

- one:
    clm1: test
    clm2: test

test/unit/xxx.rb

test "load_yml_obj" do
  assert_not_nil xxxs(:one)
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM