diff --git a/plugins/mezuro/lib/kalibro/process_time.rb b/plugins/mezuro/lib/kalibro/process_time.rb new file mode 100644 index 0000000..f0af321 --- /dev/null +++ b/plugins/mezuro/lib/kalibro/process_time.rb @@ -0,0 +1,5 @@ +class Kalibro::ProcessTime < Kalibro::Model + + attr_accessor :state, :time + +end diff --git a/plugins/mezuro/test/fixtures/process_time_fixtures.rb b/plugins/mezuro/test/fixtures/process_time_fixtures.rb new file mode 100644 index 0000000..cef8e4d --- /dev/null +++ b/plugins/mezuro/test/fixtures/process_time_fixtures.rb @@ -0,0 +1,11 @@ +class ProcessTimeFixtures + + def self.process_time + Kalibro::ProcessTime.new process_time_hash + end + + def self.process_time_hash + {:state => "Ready", :time => 1} + end + +end diff --git a/plugins/mezuro/test/unit/kalibro/process_time_test.rb b/plugins/mezuro/test/unit/kalibro/process_time_test.rb new file mode 100644 index 0000000..7603c1b --- /dev/null +++ b/plugins/mezuro/test/unit/kalibro/process_time_test.rb @@ -0,0 +1,20 @@ +require "test_helper" + +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/process_time_fixtures" + +class ProcessTimeTest < ActiveSupport::TestCase + + def setup + @hash = ProcessTimeFixtures.process_time_hash + @process_time = ProcessTimeFixtures.process_time + end + + should 'create process time from hash' do + assert_equal @hash[:state], Kalibro::ProcessTime.new(@hash).state + end + + should 'convert process time to hash' do + assert_equal @hash, @process_time.to_hash + end + +end -- libgit2 0.21.2