spec/redlander/node_spec.rb in redlander-0.3.3 vs spec/redlander/node_spec.rb in redlander-0.3.5

- old
+ new

@@ -2,16 +2,18 @@ require 'date' describe Node do - it "should be created with default options" do - lambda { Node.new }.should_not raise_exception - end + describe "blank" do + subject { Node.new } - it "should create a blank node" do - Node.new.should be_blank + it { should be_blank } + + it "should have a blank identifier for a blank node" do + subject.value.should match(/^_:\w+$/) + end end it "should create a resource node" do resource_uri = URI.parse('http://example.com/nodes#node_1') Node.new(resource_uri).should be_resource @@ -68,14 +70,9 @@ t = Time.now node = Node.new(t) node.value.should be_an_instance_of(Time) # surprisingly, two instances of the same time do not compare node.value.xmlschema.should eql(t.xmlschema) - end - - it "should have a blank identifier for a blank node" do - node = Node.new - node.value.should match(/^_:\w+$/) end it "should have an instance of URI for a resource node" do resource_uri = URI.parse('http://example.com/nodes#node_1') Node.new(resource_uri).value.should be_an_instance_of(URI::HTTP)