Sha256: f8ebc7aec8bea6866ecab6d837d30bb289c92d57513c0d6d4d0c14f7580a4629
Contents?: true
Size: 1.94 KB
Versions: 1
Compression:
Stored size: 1.94 KB
Contents
# encoding: UTF-8 require_relative '../../test_helper' describe PrayerTimes::CalculationMethod do let(:method_name){"Medina"} let(:description){"Medina testing methods"} describe "Object" do subject{PrayerTimes::CalculationMethod.new(method_name, description,{})} it {subject.must_respond_to :description} it {subject.must_respond_to :description=} it {subject.must_respond_to :settings} it {subject.must_respond_to :settings=} it {subject.must_respond_to :offsets} it {subject.must_respond_to :offsets=} end describe "#initialize" do context "when method_name and description are provided" do subject{PrayerTimes::CalculationMethod.new(method_name, description)} it {subject.name.must_equal(method_name)} it {subject.description.must_equal(description)} end context "when settings are not provided" do subject{PrayerTimes::CalculationMethod.new(method_name, description, {})} it {subject.settings.must_equal(PrayerTimes::CalculationMethod.default_settings)} end context "when settings are provided" do let(:opts){{ fajr: 18, asr: 'Hanafi', isha: 18 }} subject{PrayerTimes::CalculationMethod.new(method_name, description,opts)} it {subject.settings.must_equal(PrayerTimes::CalculationMethod.default_settings.merge opts)} end context "when offsets are not provided" do subject{PrayerTimes::CalculationMethod.new(method_name, description, {}, {})} it {subject.offsets.must_equal(PrayerTimes::Constants.times_offsets)} end context "when offsets are provided" do let(:opts){{ fajr: 3, asr: -1, isha: 6 }} subject{PrayerTimes::CalculationMethod.new(method_name, description,{},opts)} it {subject.offsets.must_equal(PrayerTimes::Constants.times_offsets.merge opts)} end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
prayer_times-0.1.1 | test/lib/prayer_times/calculation_method_test.rb |