spec/unit/reader/test_alf_file.rb in alf-0.9.2 vs spec/unit/reader/test_alf_file.rb in alf-0.9.3
- old
+ new
@@ -1,13 +1,16 @@
require 'spec_helper'
module Alf
describe Reader::AlfFile do
- let(:io){ StringIO.new(expr) }
- def dataset(name)
- [{:status => 10},{:status => 30}]
+ class TestEnv < Alf::Environment
+ def dataset(name)
+ [{:status => 10},{:status => 30}]
+ end
end
- subject{ Reader::AlfFile.new(io, self).to_a }
+
+ let(:io){ StringIO.new(expr) }
+ subject{ Reader::AlfFile.new(io, TestEnv.new).to_a }
describe "on pure functional expressions" do
let(:expr){ "(restrict :suppliers, lambda{status > 20})" }
it{ should == [{:status => 30}]}
end
\ No newline at end of file