require "spec_helper" RSpec.describe "Element#class_name" do html <<-HTML
HTML it "should return the elements' class name" do Element.find('#foo').class_name.should == "whiskey" Element.find('#bar').class_name.should == "scotch brandy" end it "should return an empty string for element with no class name" do Element.find('#baz').class_name.should == "" Element.find('#buz').class_name.should == "" end it "should return class name for first element if more than 1 in set" do Element.find('.red').class_name.should == "red dark" end it "should return an empty string for instances with no elements" do Element.find('.no-elements').class_name.should == "" end end RSpec.describe "Element#class_name=" do before do @div = Element.parse <<-HTML