Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add RSpec support and first spec

  • Loading branch information...
commit 9f71d584137fe4da620b424e07a0eb59aac8b16f 1 parent 8f9ff9c
@jarijokinen authored
View
2  .rspec
@@ -0,0 +1,2 @@
+--color
+--format documentation
View
2  html5-beautifier.gemspec
@@ -14,6 +14,8 @@ Gem::Specification.new do |gem|
gem.files = `git ls-files`.split($/)
gem.require_paths = ["lib"]
+ gem.test_files = gem.files.grep(%r{^(spec)/})
gem.add_dependency "nokogiri"
+ gem.add_development_dependency "rspec"
end
View
16 spec/beautifier_spec.rb
@@ -0,0 +1,16 @@
+require "spec_helper"
+
+html5_hello_world = <<EOF
+<!DOCTYPE html>
+<html>
+ <body>
+ <p>Hello World</p>
+ </body>
+</html>
+EOF
+
+describe "Beautifier" do
+ it "reformats a string 'Hello World' correctly" do
+ "Hello World".beautify.should eq(html5_hello_world)
+ end
+end
View
14 spec/spec_helper.rb
@@ -0,0 +1,14 @@
+require "html5-beautifier"
+
+RSpec.configure do |config|
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.run_all_when_everything_filtered = true
+ config.filter_run :focus
+
+ # Run specs in random order to surface order dependencies. If you find an
+ # order dependency and want to debug it, you can fix the order by providing
+ # the seed, which is printed after each run.
+ # --seed 1234
+ config.order = 'random'
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.