Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add specs for equations

  • Loading branch information...
commit 355416a92463596a41533c8eaed6bb4f8d9d9d09 1 parent 0ae9e5f
Kevin Olbrich olbrich authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 spec/ruby-units/unit_spec.rb
10 spec/ruby-units/unit_spec.rb
View
@@ -1375,3 +1375,13 @@
end
end
+
+describe "Equations with Units" do
+ context "Ideal Gas Law" do
+ let(:p) { Unit('100 kPa') }
+ let(:v) { Unit('1 m^3') }
+ let(:n) { Unit("1 mole") }
+ let(:r) { Unit("8.31451 J/mol*degK") }
+ specify { ((p*v)/(n*r)).convert_to('tempK').should be_within(Unit("0.1 degK")).of(Unit("12027.2 tempK")) }
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.