Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
f-moya committed Jul 3, 2024
1 parent 4f962ab commit 199eb53
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This repository uses [Rspec](https://rspec.info/) for testing and [simplecov](ht

## Requirements

- Ruby 2.7 or above
- Test run with [bundle exec rspec](https://rspec.info/)
- An account on Qlty (free for open source)
- `QLTY_COVERAGE_TOKEN` is set as a GitHub Actions [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)
Expand All @@ -29,3 +28,7 @@ Join the our [Slack Community](https://example.com) for help and to provide feed
## License

[MIT License](./LICENSE.md)

## Support

You can can contact us at https://qlty.ai/support
3 changes: 1 addition & 2 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ set -euo pipefail
IFS=$'\n\t'
set -vx

puts "Installing gems"
bundle install

# Do any other automated setup that you need to do here
26 changes: 26 additions & 0 deletions lib/dog.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is the dog class
class Dog
def initialize(name)
@name = name
end

# This method is currently covered by a test
def name
"#{@name}!!!"
end

# FIXME: add a condition
# This method is NOT currently covered by a test
def age_in_dog_years
46
end

def age_in_human_years
9
end

def bark
name
end
end

17 changes: 17 additions & 0 deletions spec/dog_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true
require "dog"

RSpec.describe Dog do
describe "#name" do
it "is super excited about its name" do
expect(Dog.new("Milo").name).to eq("Milo!!!")
end
end

describe "#age_in_dog_years" do
it "is 45 for some reason" do
expect(Dog.new("Milo").age_in_dog_years).to eq 46
end
end
end

10 changes: 7 additions & 3 deletions spec/sample_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# frozen_string_literal: true

RSpec.describe Sample do
it "can add two numbers" do
expect(Sample.add(3,4)).to eq(7)
end
# it "can add two numbers" do
# expect(Sample.add(3,4)).to eq(7)
# end

it "can add subtract numbers" do
expect(Sample.subtract(5,2)).to eq(3)
end

it "can add multiply numbers" do
expect(Sample.multiply(5,2)).to eq(10)
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

require "sample"


RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
Expand Down

0 comments on commit 199eb53

Please sign in to comment.