spec/it_spec.rb in it-0.2.0 vs spec/it_spec.rb in it-0.2.1
- old
+ new
@@ -15,11 +15,11 @@
it "should accept two params" do
expect { It.link("http://www.rubyonrails.org/", {:id => "identity", :class => "classy"}) }.not_to raise_error
end
it "should raise ArgumentError, if called with three params" do
- expect { It::Link.new("http://www.rubyonrails.org/", {}, :blubb) }.to raise_error(ArgumentError)
+ expect { It.link("http://www.rubyonrails.org/", {}, :blubb) }.to raise_error(ArgumentError)
end
end
describe It, '.tag' do
it "should return an It::Tag object" do
@@ -34,7 +34,25 @@
expect { It.tag(:b, :class => "very_bold") }.not_to raise_error
end
it "should raise an ArgumentError if called with three params" do
expect { It.tag(:b, {}, :blubb) }.to raise_error(ArgumentError)
+ end
+end
+
+describe It, '.plain' do
+ it "should return an It::Plain object" do
+ It.plain.class.should == It::Plain
+ end
+
+ it "should work without params" do
+ expect { It.plain }.not_to raise_error
+ end
+
+ it "should accept one param" do
+ expect { It.plain("%s[http://www.rubyonrails.org/]") }.not_to raise_error
+ end
+
+ it "should raise ArgumentError, if called with two params" do
+ expect { It.plain("%s[http://www.rubyonrails.org/]", :blubb) }.to raise_error(ArgumentError)
end
end
\ No newline at end of file