Module: Gerd::Inspections::Organisation
- Defined in:
- lib/gerd/inspections/diffs/organisation.rb,
lib/gerd/inspections/actions/update_name_action.rb
Defined Under Namespace
Modules: Actions
Classes: Diff
Class Method Summary
collapse
Class Method Details
.inspect_expected_teams_exist(expected, actual) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/gerd/inspections/diffs/organisation.rb', line 32
def self.inspect_expected_teams_exist(expected, actual)
diffs = []
expected_teams = expected.teams
actual_teams = actual.teams
expected_teams.keys.each do | expected_team |
if !actual_teams.keys.include? expected_team
team_to_create = expected_teams[expected_team]
action = Gerd::Inspections::Actions::CreateTeam.new(expected_team, expected.organisation, team_to_create)
diffs << Gerd::Inspections::Diff.new(false, "I expected to see team #{expected_team} but did not", [action])
end
end
diffs.flatten
end
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/gerd/inspections/diffs/organisation.rb', line 52
def self.(expected, actual)
diffs = []
expected_teams = expected.teams
actual_teams = actual.teams
actual_teams.keys.each do | team |
if !expected_teams.keys.include? team
action = Gerd::Inspections::Actions::DeleteTeam.new(actual_teams[team])
diffs << Gerd::Inspections::Diff.new(false, "I did not expect to see team #{team} but saw it anyway", [action])
end
end
diffs
end
|
.inspect_organisations(expected, actual) ⇒ Object
.inspect_teams(expected, actual) ⇒ Object
22
23
24
25
26
27
28
29
30
|
# File 'lib/gerd/inspections/diffs/organisation.rb', line 22
def self.inspect_teams(expected, actual)
diffs = []
diffs << inspect_expected_teams_exist(expected, actual)
diffs << (expected, actual)
diffs.flatten
end
|