diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/app_test.rb | 6 | ||||
| -rw-r--r-- | test/day_entry_test.rb | 2 | ||||
| -rw-r--r-- | test/timesheet_resource_test.rb | 9 | 
3 files changed, 10 insertions, 7 deletions
| diff --git a/test/app_test.rb b/test/app_test.rb index 68e3782..19678fd 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -23,7 +23,7 @@ class AppTest < HCl::TestCase      app = HCl::App.new      throttled = states('throttled').starts_as(false)      app.expects(:show). -      raises(HCl::TimesheetResource::ThrottleFailure, stub(headers:{'Retry-After' => 42})). +      raises(HCl::HarvestMiddleware::ThrottleFailure, {headers:{'Retry-After' => 42}}).        then(throttled.is(true))      app.expects(:sleep).with(47).when(throttled.is(true))      app.expects(:show).when(throttled.is(true)) @@ -48,7 +48,7 @@ class AppTest < HCl::TestCase    def test_configure_on_auth_failure      app = HCl::App.new      configured = states('configured').starts_as(false) -    app.expects(:show).raises(HCl::TimesheetResource::AuthFailure).when(configured.is(false)) +    app.expects(:show).raises(HCl::HarvestMiddleware::AuthFailure).when(configured.is(false))      app.expects(:ask).returns('xxx').times(4).when(configured.is(false))      app.expects(:write_config).then(configured.is(true))      app.expects(:show).when(configured.is(true)) @@ -58,7 +58,7 @@ class AppTest < HCl::TestCase    def test_api_failure      app = HCl::App.new -    app.expects(:show).raises(HCl::TimesheetResource::Failure) +    app.expects(:show).raises(HCl::HarvestMiddleware::Failure)      app.expects(:exit).with(1)      app.process_args('show').run      assert_match /API failure/i, error_output diff --git a/test/day_entry_test.rb b/test/day_entry_test.rb index 1df4cba..ec2abe2 100644 --- a/test/day_entry_test.rb +++ b/test/day_entry_test.rb @@ -9,7 +9,7 @@ class DayEntryTest < HCl::TestCase    def test_cancel_failure      entry = HCl::DayEntry.new(id:123) -    HCl::DayEntry.expects(:delete).raises(HCl::TimesheetResource::Failure) +    HCl::DayEntry.expects(:delete).raises(HCl::HarvestMiddleware::Failure)      assert !entry.cancel    end diff --git a/test/timesheet_resource_test.rb b/test/timesheet_resource_test.rb index 4153429..1f1b1de 100644 --- a/test/timesheet_resource_test.rb +++ b/test/timesheet_resource_test.rb @@ -19,19 +19,22 @@ class TimesheetResourceTest < HCl::TestCase    end    def test_http_get -    FakeWeb.register_uri(:get, "https://bob:secret@bobclock.harvestapp.com/foo", :body => 'gotten!') +    FakeWeb.register_uri(:get, "https://bob:secret@bobclock.harvestapp.com/foo", +                         :body => 'gotten!'.inspect)      body = HCl::TimesheetResource.get 'foo'      assert_equal 'gotten!', body    end    def test_http_post -    FakeWeb.register_uri(:post, "https://bob:secret@bobclock.harvestapp.com/foo", :body => 'posted!') +    FakeWeb.register_uri(:post, "https://bob:secret@bobclock.harvestapp.com/foo", +                         :body => 'posted!'.inspect)      body = HCl::TimesheetResource.post 'foo', {pizza:'taco'}      assert_equal 'posted!', body    end    def test_http_delete -    FakeWeb.register_uri(:delete, "https://bob:secret@bobclock.harvestapp.com/foo", :body => 'wiped!') +    FakeWeb.register_uri(:delete, "https://bob:secret@bobclock.harvestapp.com/foo", +                         :body => 'wiped!'.inspect)      body = HCl::TimesheetResource.delete 'foo'      assert_equal 'wiped!', body    end | 
