Apply automatic rubocop fixes
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rack/file'
|
||||
require 'capybara/rspec'
|
||||
|
||||
|
@ -18,7 +18,7 @@ external_user = FactoryBot.create(:external_user)
|
||||
ExecutionEnvironment.create_factories user: admin
|
||||
|
||||
# exercises
|
||||
@exercises = find_factories_by_class(Exercise).map(&:name).map { |factory_name| [factory_name, FactoryBot.create(factory_name, user: teacher)] }.to_h
|
||||
@exercises = find_factories_by_class(Exercise).map(&:name).index_with {|factory_name| FactoryBot.create(factory_name, user: teacher) }
|
||||
|
||||
# file types
|
||||
FileType.create_factories
|
||||
|
@ -1,2 +1,3 @@
|
||||
def fibonacci(n)
|
||||
end
|
||||
# frozen_string_literal: true
|
||||
|
||||
def fibonacci(n); end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require './exercise'
|
||||
|
||||
describe '#fibonacci' do
|
||||
|
@ -1,9 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require './exercise'
|
||||
|
||||
describe '#fibonacci' do
|
||||
it 'works recursively' do
|
||||
@n = 16
|
||||
expect(self).to receive(:fibonacci).and_call_original.at_least(@n ** 2).times
|
||||
expect(self).to receive(:fibonacci).and_call_original.at_least(@n**2).times
|
||||
fibonacci(@n)
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require './exercise'
|
||||
require './reference'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Reference
|
||||
def fibonacci(n)
|
||||
n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2)
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
SOURCE_FILENAME = 'data.txt'
|
||||
TARGET_FILENAME = 'copy.txt'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require './exercise'
|
||||
|
||||
describe '#write_to_file' do
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe 'Exercise' do
|
||||
it "outputs 'Hello World" do
|
||||
expect($stdout).to receive(:puts).with('Hello World')
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'highline/import'
|
||||
|
||||
# consumers
|
||||
@ -7,7 +9,7 @@ FactoryBot.create(:consumer)
|
||||
email = ask('Enter admin email: ')
|
||||
|
||||
passwords = ['password', 'password confirmation'].map do |attribute|
|
||||
ask("Enter admin #{attribute}: ") { |question| question.echo = false }
|
||||
ask("Enter admin #{attribute}: ") {|question| question.echo = false }
|
||||
end
|
||||
|
||||
if passwords.uniq.length == 1
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'sqlite3'
|
||||
|
||||
REFERENCE_QUERY = File.new('reference.sql', 'r').read
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe 'Exercise' do
|
||||
it 'includes a successful example' do
|
||||
expect(true).to be true
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'sinatra'
|
||||
|
||||
set :bind, '0.0.0.0'
|
||||
|
Reference in New Issue
Block a user