diff --git a/test/client_test.rb b/test/client_test.rb index c80fc86..306e50f 100644 --- a/test/client_test.rb +++ b/test/client_test.rb @@ -2,7 +2,7 @@ describe TrackerApi do it 'has a version' do - ::TrackerApi::VERSION.wont_be_nil + _(::TrackerApi::VERSION).wont_be_nil end end @@ -13,10 +13,10 @@ token: '12345', logger: LOGGER) - client.url.must_equal 'http://test.com' - client.api_version.must_equal '/foo-bar/1' - client.token.must_equal '12345' - client.logger.must_equal LOGGER + _(client.url).must_equal 'http://test.com' + _(client.api_version).must_equal '/foo-bar/1' + _(client.token).must_equal '12345' + _(client.logger).must_equal LOGGER end describe '.projects' do @@ -27,18 +27,18 @@ VCR.use_cassette('get all projects', record: :new_episodes) do projects = client.projects(fields: ':default,account,current_velocity,labels(name),epics(:default,label(name))') - projects.wont_be_empty + _(projects).wont_be_empty project = projects.first - project.must_be_instance_of TrackerApi::Resources::Project - project.id.must_equal pt_user[:project_id] + _(project).must_be_instance_of TrackerApi::Resources::Project + _(project.id).must_equal pt_user[:project_id] - project.account.must_be_instance_of TrackerApi::Resources::Account + _(project.account).must_be_instance_of TrackerApi::Resources::Account - project.labels.wont_be_empty - project.labels.first.must_be_instance_of TrackerApi::Resources::Label + _(project.labels).wont_be_empty + _(project.labels.first).must_be_instance_of TrackerApi::Resources::Label - project.epics.wont_be_empty - project.epics.first.must_be_instance_of TrackerApi::Resources::Epic + _(project.epics).wont_be_empty + _(project.epics.first).must_be_instance_of TrackerApi::Resources::Epic end end end @@ -52,11 +52,11 @@ VCR.use_cassette('get project', record: :new_episodes) do project = client.project(project_id) - project.must_be_instance_of TrackerApi::Resources::Project - project.id.must_equal project_id + _(project).must_be_instance_of TrackerApi::Resources::Project + _(project.id).must_equal project_id - project.account.must_be_nil - project.account_id.wont_be_nil + _(project.account).must_be_nil + _(project.account_id).wont_be_nil end end end @@ -69,9 +69,9 @@ VCR.use_cassette('get workspace', record: :new_episodes) do workspace = client.workspace(pt_user[:workspace_id]) - workspace.must_be_instance_of TrackerApi::Resources::Workspace - workspace.id.must_equal pt_user[:workspace_id] - workspace.name.wont_be_empty + _(workspace).must_be_instance_of TrackerApi::Resources::Workspace + _(workspace.id).must_equal pt_user[:workspace_id] + _(workspace.name).wont_be_empty end end end @@ -85,10 +85,10 @@ VCR.use_cassette('get all workspaces', record: :new_episodes) do workspaces = client.workspaces(fields: ':default,projects(id,name)') - workspaces.wont_be_empty + _(workspaces).wont_be_empty workspace = workspaces.first - workspace.must_be_instance_of TrackerApi::Resources::Workspace - workspace.id.must_equal pt_user[:workspace_id] + _(workspace).must_be_instance_of TrackerApi::Resources::Workspace + _(workspace.id).must_equal pt_user[:workspace_id] end end end @@ -105,10 +105,10 @@ VCR.use_cassette('get me', record: :new_episodes) do me = client.me - me.must_be_instance_of TrackerApi::Resources::Me - me.username.must_equal username + _(me).must_be_instance_of TrackerApi::Resources::Me + _(me.username).must_equal username - me.projects.map(&:project_id).must_include project_id + _(me.projects.map(&:project_id)).must_include project_id end end end @@ -124,14 +124,14 @@ # skip pagination with a hugh limit unpaged_stories = project.stories(limit: 300) - unpaged_stories.wont_be_empty - unpaged_stories.length.must_be :>, 7 + _(unpaged_stories).wont_be_empty + _(unpaged_stories.length).must_be :>, 7 # force pagination with a small limit paged_stories = project.stories(limit: 7) - paged_stories.wont_be_empty - paged_stories.length.must_equal unpaged_stories.length - paged_stories.map(&:id).sort.uniq.must_equal unpaged_stories.map(&:id).sort.uniq + _(paged_stories).wont_be_empty + _(paged_stories.length).must_equal unpaged_stories.length + _(paged_stories.map(&:id).sort.uniq).must_equal unpaged_stories.map(&:id).sort.uniq end end @@ -141,8 +141,8 @@ # force no pagination stories = project.stories(limit: 7, auto_paginate: false) - stories.wont_be_empty - stories.length.must_equal 7 + _(stories).wont_be_empty + _(stories.length).must_equal 7 end end @@ -152,8 +152,8 @@ done_iterations = project.iterations(scope: :done, offset: -12, limit: 5) - done_iterations.wont_be_empty - done_iterations.length.must_be :<=, 12 + _(done_iterations).wont_be_empty + _(done_iterations.length).must_be :<=, 12 end end end @@ -166,8 +166,8 @@ VCR.use_cassette('client: get single story by story id', record: :new_episodes) do story = client.story('66728004', fields: ':default,owned_by') - story.must_be_instance_of TrackerApi::Resources::Story - story.owned_by.wont_be_nil + _(story).must_be_instance_of TrackerApi::Resources::Story + _(story.owned_by).wont_be_nil end end end @@ -180,8 +180,8 @@ VCR.use_cassette('client: get single epic by epic id', record: :new_episodes) do epic = client.epic('1087314', fields: ':default,label_id') - epic.must_be_instance_of TrackerApi::Resources::Epic - epic.label_id.wont_be_nil + _(epic).must_be_instance_of TrackerApi::Resources::Epic + _(epic.label_id).wont_be_nil end end end @@ -194,13 +194,13 @@ VCR.use_cassette('get all notifications', record: :new_episodes) do notifications = client.notifications - notifications.wont_be_empty + _(notifications).wont_be_empty notification = notifications.first - notification.must_be_instance_of TrackerApi::Resources::Notification + _(notification).must_be_instance_of TrackerApi::Resources::Notification - notification.project.id.must_equal pt_user[:project_id] - notification.story.must_be_instance_of TrackerApi::Resources::Story - notification.performer.must_be_instance_of TrackerApi::Resources::Person + _(notification.project.id).must_equal pt_user[:project_id] + _(notification.story).must_be_instance_of TrackerApi::Resources::Story + _(notification.performer).must_be_instance_of TrackerApi::Resources::Person end end end @@ -213,19 +213,19 @@ VCR.use_cassette('get my activities', record: :new_episodes) do activities = client.activity(fields: ':default') - activities.wont_be_empty + _(activities).wont_be_empty activity = activities.first - activity.must_be_instance_of TrackerApi::Resources::Activity + _(activity).must_be_instance_of TrackerApi::Resources::Activity - activity.changes.wont_be_empty - activity.changes.first.must_be_instance_of TrackerApi::Resources::Change + _(activity.changes).wont_be_empty + _(activity.changes.first).must_be_instance_of TrackerApi::Resources::Change - activity.primary_resources.wont_be_empty - activity.primary_resources.first.must_be_instance_of TrackerApi::Resources::PrimaryResource + _(activity.primary_resources).wont_be_empty + _(activity.primary_resources.first).must_be_instance_of TrackerApi::Resources::PrimaryResource - activity.project.must_be_instance_of TrackerApi::Resources::Project + _(activity.project).must_be_instance_of TrackerApi::Resources::Project - activity.performed_by.must_be_instance_of TrackerApi::Resources::Person + _(activity.performed_by).must_be_instance_of TrackerApi::Resources::Person end end end diff --git a/test/comment_test.rb b/test/comment_test.rb index 0eb5e91..14230dc 100644 --- a/test/comment_test.rb +++ b/test/comment_test.rb @@ -17,8 +17,8 @@ comment = story.create_comment(text: text) end - comment.text.must_equal text - comment.clean?.must_equal true + _(comment.text).must_equal text + _(comment.clean?).must_equal true end it 'can create a comment with file attachment' do @@ -28,9 +28,9 @@ VCR.use_cassette('create comment with attachment', record: :new_episodes) do comment = story.create_comment(text: text, files: files) end - comment.text.must_equal text - comment.attachments.size.must_equal 1 - comment.clean?.must_equal true + _(comment.text).must_equal text + _(comment.attachments.size).must_equal 1 + _(comment.clean?).must_equal true end it 'can update an existing comment' do @@ -41,16 +41,16 @@ existing_comment.save end - existing_comment.text.must_equal new_text - existing_comment.clean?.must_equal true + _(existing_comment.text).must_equal new_text + _(existing_comment.clean?).must_equal true end it 'can create attachments in a comment' do files = [File.expand_path('../Gemfile', File.dirname(__FILE__))] VCR.use_cassette('create attachments', record: :new_episodes) do existing_comment.create_attachments(files: files) - existing_comment.attachments.size.must_equal 1 - existing_comment.clean?.must_equal true + _(existing_comment.attachments.size).must_equal 1 + _(existing_comment.clean?).must_equal true end end @@ -58,9 +58,9 @@ files = [File.expand_path('../Gemfile', File.dirname(__FILE__))] VCR.use_cassette('delete attachments', record: :new_episodes) do existing_comment.create_attachments(files: files) - existing_comment.attachments.size.must_equal 1 + _(existing_comment.attachments.size).must_equal 1 existing_comment.delete_attachments - existing_comment.attachments.size.must_equal 0 + _(existing_comment.attachments.size).must_equal 0 end end @@ -68,10 +68,10 @@ VCR.use_cassette('delete comment', record: :new_episodes) do current_story = project.story(story_id) new_comment_id = current_story.create_comment(text: "test comment").id - current_story.comments.last.id.must_equal new_comment_id + _(current_story.comments.last.id).must_equal new_comment_id current_story.comments.last.delete current_story = project.story(story_id) - current_story.comments.last.id.wont_equal new_comment_id + _(current_story.comments.last.id).wont_equal new_comment_id end end end diff --git a/test/file_attachment_test.rb b/test/file_attachment_test.rb index 5331b1a..6c8c29a 100644 --- a/test/file_attachment_test.rb +++ b/test/file_attachment_test.rb @@ -11,9 +11,9 @@ it 'can be deleted' do VCR.use_cassette('delete an attachment', record: :new_episodes) do comment_with_attachments = story.create_comment(text: "test comment", files: [File.expand_path('../Gemfile', File.dirname(__FILE__))]) - comment_with_attachments.attachments(reload: true).size.must_equal 1 + _(comment_with_attachments.attachments(reload: true).size).must_equal 1 comment_with_attachments.attachments.first.delete - comment_with_attachments.attachments(reload: true).size.must_equal 0 + _(comment_with_attachments.attachments(reload: true).size).must_equal 0 end end end diff --git a/test/minitest_helper.rb b/test/minitest_helper.rb index 1e4bb4d..8fc64a8 100644 --- a/test/minitest_helper.rb +++ b/test/minitest_helper.rb @@ -6,7 +6,10 @@ require 'minitest/byebug' if ENV['DEBUG'] require 'minitest/autorun' -require 'mocha/mini_test' + +require 'mocha' +Mocha::VERSION.to_f >= 1.9 ? require('mocha/minitest') : require('mocha/mini_test') + require 'awesome_print' require 'multi_json' require 'vcr' diff --git a/test/project_test.rb b/test/project_test.rb index b2b24dc..c2d026e 100644 --- a/test/project_test.rb +++ b/test/project_test.rb @@ -11,9 +11,9 @@ VCR.use_cassette('get epics', record: :new_episodes) do epics = project.epics - epics.wont_be_empty + _(epics).wont_be_empty epic = epics.first - epic.must_be_instance_of TrackerApi::Resources::Epic + _(epic).must_be_instance_of TrackerApi::Resources::Epic end end @@ -28,9 +28,9 @@ it 'does not make an extra request' do epics = project_with_epics.epics - epics.wont_be_empty + _(epics).wont_be_empty epic = epics.first - epic.must_be_instance_of TrackerApi::Resources::Epic + _(epic).must_be_instance_of TrackerApi::Resources::Epic end end end @@ -46,9 +46,9 @@ it 'gets all labels for this project' do labels = project_with_labels.labels - labels.wont_be_empty + _(labels).wont_be_empty label = labels.first - label.must_be_instance_of TrackerApi::Resources::Label + _(label).must_be_instance_of TrackerApi::Resources::Label end end @@ -56,9 +56,9 @@ VCR.use_cassette('get labels', record: :new_episodes) do labels = project.labels - labels.wont_be_empty + _(labels).wont_be_empty label = labels.first - label.must_be_instance_of TrackerApi::Resources::Label + _(label).must_be_instance_of TrackerApi::Resources::Label end end end @@ -69,11 +69,11 @@ offset = -project.number_of_done_iterations_to_show.to_i done_iterations = project.iterations(scope: :done, offset: offset) - done_iterations.wont_be_empty - done_iterations.length.must_be :<=, project.number_of_done_iterations_to_show + _(done_iterations).wont_be_empty + _(done_iterations.length).must_be :<=, project.number_of_done_iterations_to_show iteration = done_iterations.first - iteration.must_be_instance_of TrackerApi::Resources::Iteration + _(iteration).must_be_instance_of TrackerApi::Resources::Iteration end end @@ -81,14 +81,14 @@ VCR.use_cassette('get current iteration', record: :new_episodes) do iterations = project.iterations(scope: :current) - iterations.wont_be_empty + _(iterations).wont_be_empty current = iterations.first - current.must_be_instance_of TrackerApi::Resources::Iteration - current.stories.wont_be_empty + _(current).must_be_instance_of TrackerApi::Resources::Iteration + _(current.stories).wont_be_empty story = current.stories.first - story.must_be_instance_of TrackerApi::Resources::Story + _(story).must_be_instance_of TrackerApi::Resources::Story end end @@ -96,13 +96,13 @@ VCR.use_cassette('get current iteration', record: :new_episodes) do iterations = project.iterations(scope: :current, fields: ":default,velocity,points,accepted_points,effective_points") - iterations.wont_be_empty + _(iterations).wont_be_empty current = iterations.first - current.velocity.must_equal 10.0 - current.points.must_equal 9.0 - current.accepted_points.must_equal 0 - current.effective_points.must_equal 9.0 + _(current.velocity).must_equal 10.0 + _(current.points).must_equal 9.0 + _(current.accepted_points).must_equal 0 + _(current.effective_points).must_equal 9.0 end end @@ -110,26 +110,26 @@ VCR.use_cassette('get iteration by number', record: :new_episodes) do iterations = project.iterations(number: 2) - iterations.size.must_equal 1 - iterations.first.must_be_instance_of TrackerApi::Resources::Iteration - iterations.first.number.must_equal 2 + _(iterations.size).must_equal 1 + _(iterations.first).must_be_instance_of TrackerApi::Resources::Iteration + _(iterations.first.number).must_equal 2 iterations = project.iterations(number: 1) - iterations.size.must_equal 1 - iterations.first.must_be_instance_of TrackerApi::Resources::Iteration - iterations.first.number.must_equal 1 + _(iterations.size).must_equal 1 + _(iterations.first).must_be_instance_of TrackerApi::Resources::Iteration + _(iterations.first.number).must_equal 1 iterations = project.iterations(number: 10_000) - iterations.must_be_empty + _(iterations).must_be_empty end end it 'requires an iteration number > 0' do VCR.use_cassette('get iteration by number', record: :new_episodes) do - -> { project.iterations(number: 0) }.must_raise(ArgumentError, /> 0/) - -> { project.iterations(number: -1) }.must_raise(ArgumentError, /> 0/) + _(-> { project.iterations(number: 0) }).must_raise(ArgumentError, /> 0/) + _(-> { project.iterations(number: -1) }).must_raise(ArgumentError, /> 0/) end end end @@ -139,11 +139,11 @@ VCR.use_cassette('get unscheduled stories', record: :new_episodes) do stories = project.stories(with_state: :unscheduled) - stories.wont_be_empty + _(stories).wont_be_empty story = stories.first - story.must_be_instance_of TrackerApi::Resources::Story - story.current_state.must_equal 'unscheduled' + _(story).must_be_instance_of TrackerApi::Resources::Story + _(story.current_state).must_equal 'unscheduled' end end @@ -151,10 +151,10 @@ VCR.use_cassette('create story') do story = project.create_story(name: 'Test story') - story.must_be_instance_of TrackerApi::Resources::Story - story.id.wont_be_nil - story.id.must_be :>, 0 - story.name.must_equal 'Test story' + _(story).must_be_instance_of TrackerApi::Resources::Story + _(_(story.id)).wont_be_nil + _(story.id).must_be :>, 0 + _(story.name).must_equal 'Test story' end end @@ -162,10 +162,10 @@ VCR.use_cassette('create story with lengthy params') do story = project.create_story(name: 'Test story', description: ('Test description ' * 500)) - story.must_be_instance_of TrackerApi::Resources::Story - story.id.wont_be_nil - story.id.must_be :>, 0 - story.description.must_equal ('Test description ' * 500) + _(story).must_be_instance_of TrackerApi::Resources::Story + _(_(story.id)).wont_be_nil + _(story.id).must_be :>, 0 + _(story.description).must_equal ('Test description ' * 500) end end end @@ -186,9 +186,9 @@ VCR.use_cassette('get project activity', record: :new_episodes) do activity = project.activity - activity.wont_be_empty + _(activity).wont_be_empty event = activity.first - event.must_be_instance_of TrackerApi::Resources::Activity + _(event).must_be_instance_of TrackerApi::Resources::Activity end end end @@ -201,11 +201,11 @@ project = client.project(pt_user[:project_id]) search_container = project.search('name:"story to test search"') - search_container.wont_be_nil - search_container.must_be_instance_of TrackerApi::Resources::SearchResultContainer - search_container.epics.must_be_instance_of TrackerApi::Resources::EpicsSearchResult - search_container.stories.must_be_instance_of TrackerApi::Resources::StoriesSearchResult - search_container.stories.stories.first[:id].must_equal 143444685 + _(search_container).wont_be_nil + _(search_container).must_be_instance_of TrackerApi::Resources::SearchResultContainer + _(search_container.epics).must_be_instance_of TrackerApi::Resources::EpicsSearchResult + _(search_container.stories).must_be_instance_of TrackerApi::Resources::StoriesSearchResult + _(search_container.stories.stories.first[:id]).must_equal 143444685 end end end @@ -215,9 +215,9 @@ VCR.use_cassette('get releases', record: :new_episodes) do releases = project.releases - releases.wont_be_empty - releases.size.must_equal 3 - releases.first.must_be_instance_of TrackerApi::Resources::Release + _(releases).wont_be_empty + _(releases.size).must_equal 3 + _(releases.first).must_be_instance_of TrackerApi::Resources::Release end end end diff --git a/test/release_test.rb b/test/release_test.rb index e3b88ab..a9097d7 100644 --- a/test/release_test.rb +++ b/test/release_test.rb @@ -10,12 +10,12 @@ it 'returns all the stories related to a release' do releases = VCR.use_cassette('get releases') { project.releases } release = releases.find { |release| release.name == 'Beta launch' } - + VCR.use_cassette('release stories', record: :new_episodes) do stories = release.stories - stories.size.must_equal 9 - stories.first.must_be_instance_of TrackerApi::Resources::Story + _(stories.size).must_equal 9 + _(stories.first).must_be_instance_of TrackerApi::Resources::Story end end end diff --git a/test/story_test.rb b/test/story_test.rb index b1f180e..e6b269e 100644 --- a/test/story_test.rb +++ b/test/story_test.rb @@ -22,8 +22,8 @@ story.save end - story.name.must_equal new_name - story.clean?.must_equal true + _(story.name).must_equal new_name + _(story.clean?).must_equal true end it 'can update multiple attributes of an existing story at once' do @@ -36,14 +36,14 @@ story.save end - story.name.must_equal new_name - story.description.must_equal new_desc + _(story.name).must_equal new_name + _(story.description).must_equal new_desc end it 'can add new labels to an existing story' do new_label_name = "super-special-label" - story.labels.map(&:name).wont_include new_label_name + _(story.labels.map(&:name)).wont_include new_label_name story.add_label(new_label_name) @@ -51,13 +51,13 @@ story.save end - story.labels.wont_be_empty - story.labels.map(&:name).must_include new_label_name + _(story.labels).wont_be_empty + _(story.labels.map(&:name)).must_include new_label_name end it 'can add new labels to an existing story without existing labels' do story = VCR.use_cassette('get story no existing labels') { project.story(story_id_no_existing_labels) } - story.labels.must_be_nil + _(story.labels).must_be_nil new_label_name = "super-special-label" story.add_label(new_label_name) @@ -66,8 +66,8 @@ story.save end - story.labels.wont_be_empty - story.labels.map(&:name).must_include new_label_name + _(story.labels).wont_be_empty + _(story.labels.map(&:name)).must_include new_label_name end it 'does not remove existing labels when updating story fields' do @@ -86,15 +86,15 @@ story_in_epic.save end - story_in_epic.labels.must_equal original_labels - story_in_epic.label_list.must_equal original_label_list + _(story_in_epic.labels).must_equal original_labels + _(story_in_epic.label_list).must_equal original_label_list end it 'does not send unmodified fields when saving' do story_with_one_change = TrackerApi::Resources::Story::UpdateRepresenter.new(TrackerApi::Resources::Story.new(name: "new_name")) expected_json = MultiJson.dump({name: "new_name"}) - expected_json.must_equal story_with_one_change.to_json + _(expected_json).must_equal story_with_one_change.to_json end it 'objects are equal based on id' do @@ -102,15 +102,15 @@ story_b = VCR.use_cassette('get story') { project.story(story_id) } story_c = VCR.use_cassette('get another story') { project.story(another_story_id) } - story_a.must_equal story_b - story_a.hash.must_equal story_b.hash - story_a.eql?(story_b).must_equal true - story_a.equal?(story_b).must_equal false + _(story_a).must_equal story_b + _(story_a.hash).must_equal story_b.hash + _(story_a.eql?(story_b)).must_equal true + _(story_a.equal?(story_b)).must_equal false - story_a.wont_equal story_c - story_a.hash.wont_equal story_c.hash - story_a.eql?(story_c).must_equal false - story_a.equal?(story_c).must_equal false + _(story_a).wont_equal story_c + _(story_a.hash).wont_equal story_c.hash + _(story_a.eql?(story_c)).must_equal false + _(story_a.equal?(story_c)).must_equal false end describe '.owners' do @@ -123,9 +123,9 @@ # it should not be making another HTTP request. owners = story.owners - owners.wont_be_empty + _(owners).wont_be_empty owner = owners.first - owner.must_be_instance_of TrackerApi::Resources::Person + _(owner).must_be_instance_of TrackerApi::Resources::Person end it 'gets all owners for this story' do @@ -133,9 +133,9 @@ story = project.story(story_id) owners = VCR.use_cassette('get owners for story') { story.owners } - owners.wont_be_empty + _(owners).wont_be_empty owner = owners.first - owner.must_be_instance_of TrackerApi::Resources::Person + _(owner).must_be_instance_of TrackerApi::Resources::Person end end end @@ -146,8 +146,8 @@ story = project.story(story_id) owner_ids = story.owner_ids - owner_ids.wont_be_empty - owner_ids.first.must_be_instance_of Fixnum + _(owner_ids).wont_be_empty + _(owner_ids.first).must_be_instance_of Fixnum end end @@ -160,16 +160,16 @@ story.owner_ids = one_owner VCR.use_cassette('save story with one owner') { story.save } - story.owner_ids.wont_be_empty - story.owner_ids.must_equal one_owner + _(story.owner_ids).wont_be_empty + _(story.owner_ids).must_equal one_owner # save with two owners two_owners = [pt_user_1_id, pt_user_2_id] story.owner_ids = two_owners VCR.use_cassette('save story with two owners') { story.save } - story.owner_ids.wont_be_empty - story.owner_ids.must_equal two_owners + _(story.owner_ids).wont_be_empty + _(story.owner_ids).must_equal two_owners end end end @@ -184,8 +184,8 @@ story.add_owner(TrackerApi::Resources::Person.new(id: 123)) - story.owner_ids.wont_be_empty - story.owner_ids.must_equal [123] + _(story.owner_ids).wont_be_empty + _(story.owner_ids).must_equal [123] end end @@ -201,8 +201,8 @@ # test dups are not added story.add_owner(123) - story.owner_ids.wont_be_empty - story.owner_ids.must_equal [123, 456] + _(story.owner_ids).wont_be_empty + _(story.owner_ids).must_equal [123, 456] end end end @@ -212,9 +212,9 @@ VCR.use_cassette('get story with tasks', record: :new_episodes) do tasks = project.story(story_id, fields: ':default,tasks').tasks - tasks.wont_be_empty + _(tasks).wont_be_empty task = tasks.first - task.must_be_instance_of TrackerApi::Resources::Task + _(task).must_be_instance_of TrackerApi::Resources::Task end end @@ -223,9 +223,9 @@ story = project.story(story_id) tasks = VCR.use_cassette('get tasks for story') { story.tasks } - tasks.wont_be_empty + _(tasks).wont_be_empty task = tasks.first - task.must_be_instance_of TrackerApi::Resources::Task + _(task).must_be_instance_of TrackerApi::Resources::Task end end @@ -236,7 +236,7 @@ tasks = story.tasks unless tasks.empty? task = tasks.first - task.must_be_instance_of TrackerApi::Resources::Task + _(task).must_be_instance_of TrackerApi::Resources::Task end end end @@ -246,10 +246,10 @@ VCR.use_cassette('create task') do task = project.story(story_id).create_task(description: 'Test task') - task.must_be_instance_of TrackerApi::Resources::Task - task.id.wont_be_nil - task.id.must_be :>, 0 - task.description.must_equal 'Test task' + _(task).must_be_instance_of TrackerApi::Resources::Task + _(task.id).wont_be_nil + _(task.id).must_be :>, 0 + _(task.description).must_equal 'Test task' end end end @@ -268,9 +268,9 @@ VCR.use_cassette('get story activity', record: :new_episodes) do activity = story.activity - activity.wont_be_empty + _(activity).wont_be_empty event = activity.first - event.must_be_instance_of TrackerApi::Resources::Activity + _(event).must_be_instance_of TrackerApi::Resources::Activity end end end @@ -284,7 +284,7 @@ comments = story.comments comment = comments.first - comment.must_be_instance_of TrackerApi::Resources::Comment + _(comment).must_be_instance_of TrackerApi::Resources::Comment end end end @@ -298,7 +298,7 @@ transitions = story.transitions transition = transitions.first - transition.must_be_instance_of TrackerApi::Resources::StoryTransition + _(transition).must_be_instance_of TrackerApi::Resources::StoryTransition end end end diff --git a/test/task_test.rb b/test/task_test.rb index c1cee85..7ddbf9a 100644 --- a/test/task_test.rb +++ b/test/task_test.rb @@ -20,8 +20,8 @@ task.save end - task.description.must_equal new_description - task.complete.must_equal true - task.clean?.must_equal true + _(task.description).must_equal new_description + _(task.complete).must_equal true + _(task.clean?).must_equal true end end diff --git a/test/workspace_test.rb b/test/workspace_test.rb index 684871f..7f4c467 100644 --- a/test/workspace_test.rb +++ b/test/workspace_test.rb @@ -12,13 +12,13 @@ workspace = client.workspace(pt_user[:workspace_id], fields: ':default,projects(id,name)') projects = workspace.projects - projects.wont_be_empty + _(projects).wont_be_empty - projects.size.must_equal 2 - projects.first.must_be_instance_of TrackerApi::Resources::Project + _(projects.size).must_equal 2 + _(projects.first).must_be_instance_of TrackerApi::Resources::Project - pt_user[:project_ids].must_include projects.first.id - pt_user[:project_ids].must_include projects.last.id + _(pt_user[:project_ids]).must_include projects.first.id + _(pt_user[:project_ids]).must_include projects.last.id end end