Sha256: 8eec085e98ba261f2c9812daeff2d4019702f28b19fb885d2a96706fe034bd80
Contents?: true
Size: 878 Bytes
Versions: 8
Compression:
Stored size: 878 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + "../../spec_helper") class MyTestPage < PageModels::Base attr_accessor :args def initialize(*args) @args = args end end describe PageModels do describe "creating instances from cucumber (or similar) text" do it "should create an instance with no args" do page_model = PageModels.create("my test page", "") page_model.args.should == [] end it "should create an instance with 1..n args" do page_model = PageModels.create("my test page", 'with "some" additional "arguments" denoted by "quotes"') page_model.args.should == ["some", "arguments", "quotes"] end it "should raise a helpful error when the class does not exist" do lambda { page_model = PageModels.create("not real page", "") }.should raise_error(PageModels::MissingPageModelError) end end end
Version data entries
8 entries across 8 versions & 1 rubygems