Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding unit tests #353

Merged
merged 4 commits into from
Jun 6, 2018
Merged

Adding unit tests #353

merged 4 commits into from
Jun 6, 2018

Conversation

Temikus
Copy link
Member

@Temikus Temikus commented Jun 6, 2018

This should help us keep models/collections the same across the board and avoid issues like #352 and help newcomers iterate quickly to avoid us needing to point out missing methods like in #348

This should help us test new model/collection contributions and help keep our collections the same across the board.
assert obj.respond_to?(:each), "#{klass} should be enumerable"
end
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/TrailingBlankLines: Final newline missing.

require "helpers/test_helper"

class UnitTestCollections < MiniTest::Test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.

t.name = "unit"
t.description = "Run Unit tests"
t.libs << "test"
t.pattern = FileList['test/unit/**/test_*.rb']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

assert obj.respond_to?(:each), "#{klass} should be enumerable"
end
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/TrailingBlankLines: Final newline missing.

require "helpers/test_helper"

class UnitTestCollections < MiniTest::Test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.

t.name = "unit"
t.description = "Run Unit tests"
t.libs << "test"
t.pattern = FileList['test/unit/**/test_*.rb']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@Temikus Temikus force-pushed the add_unit_tests branch 2 times, most recently from 3090815 to 84228d1 Compare June 6, 2018 01:39
assert obj.respond_to?(:each), "#{klass} should be enumerable"
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body end.

@Temikus
Copy link
Member Author

Temikus commented Jun 6, 2018

Wohoo \o/ Unit tests are successfully running on Travis.

Now just to fix the Projects collection.

Fog::Compute::Google::Operation,
Fog::Compute::Google::Zone,
Fog::Compute::Google::Snapshot,
Fog::Compute::Google::Project ]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideArrayLiteralBrackets: Do not use space inside array brackets.

# Top-level ancestors we do not test
common_ancestors = [Fog::Model, Fog::Compute::Server]
# Do not test models that do not have a create method in API
exceptions = [ Fog::Compute::Google::MachineType,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideArrayLiteralBrackets: Do not use space inside array brackets.

@Temikus Temikus requested review from icco and removed request for icco June 6, 2018 09:15
@Temikus
Copy link
Member Author

Temikus commented Jun 6, 2018

This should now be done.

@Temikus Temikus merged commit a2e46a2 into fog:master Jun 6, 2018
@icco
Copy link
Member

icco commented Jun 8, 2018

Thanks!

@Temikus Temikus deleted the add_unit_tests branch June 22, 2018 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants